I have a model where I want patients to move directly to bed when they arrive when there is an empty bed available. I have put the bed locations into a group which I have named "Examtables". I have tried this custom code:
Location Examtables = findObject("Examtables");
string locationGroupName = "Examtables";
int isAvailable = isLocationAvailable(Examtables, locationGroupName);
if (isAvailable == 1) {
return 1;
} else {
return 0;
}
However, I consistently get this error: Flexscript Error MODEL:/Tools/ProcessFlow/Patient Flow/Custom Code~2>variables/codeNode Unknown type Location in declaration of variable Examtables
What could be wrong with my code? I will be grateful with any assistance. Thank you.