I have the code below to check if max limit is met for hotel and division per coordinator. If limit is not met then compose doc - if met prompt with msg and do not allow to proceed. It is not working for me Please Help!
Hotel := Hotel;
choice:=@PickList( [Custom] ;@DbName ; “2007\Room Allocation” ; “Select a hotel” ; “Please select the hotel for your reservation” ;1);
TotalRooms:=@If(@IsError(@DbLookup(“” : “NoCache” ;@DbName;“SearchView”;@Name([CN];@UserName);2));0;@DbLookup(“” : “NoCache” ;@DbName;“SearchView”;@Name([CN];@UserName);2));
CurrentRooms:=@If(@IsError(@DbLookup(“” : “NoCache” ;@DbName;“SearchView”;@Name([CN];@UserName);3));0;@DbLookup(“” : “NoCache” ;@DbName;“SearchView”;@Name([CN];@UserName);3));
Division:=@If(@IsError(@DbLookup(“” : “NoCache” ;@DbName;“SearchView”;@Name([CN];@UserName);3));0;@DbLookup(“” : “NoCache” ;@DbName;“SearchView”;@Name([CN];@UserName);4));
@If(choice != “” & Division != “” & CurrentRooms>=TotalRooms;@Prompt([Ok];“Quota Exceeded or Met”;"You are unable to create any more reservations for " + choice);@Command([Compose]; @DbName ; “resv”));
@SetField(“Hotel”;“choice”)