Click TOOLS | SCRIPT EDITOR to show the Script Editor screen
 Locate "frmEditorApp" and the "OnBeforeSaveRecord" event
 Copy & Paste the following script into the Script Editor :-
- Code: Select all
frmEditorBaseRec Editor = (Params as frmEditorBaseRec);
cApp app = (Editor.Record as cApp);
if (app.room_id == null)
throw new PSExc.FriendlyException("Please enter a ROOM for this Appointment", "Room is Required");
This example works on the "app.room_id" field but you could edit this script to work on a different field, for example change "app.room_id" to "app.staff_id" to enforce a STAFF MEMBER, or "app.apptype_id" to enforce an APPOINTMENT TYPE.
We hope this is helpful! Please feel free to post a reply if you have any questions or need something to be clarified!