Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Hi,
When booking appointments, I’d like a warning if the operator has not completed both the appt type and the room number.
Thanks
[1] Click TOOLS | SCRIPT EDITOR to show the Script Editor screen
[2] Locate “frmEditorApp” and the “OnBeforeSaveRecord” event
[3] You need to Copy & Paste the following script into the Script Editor
💡 Click the little “SELECT ALL” link below and then right click on the selected text and choose COPY, then you can PASTE the script directly into the Script Editor in ClinicOffice
frmEditorBaseRec Editor = (Params[0] as frmEditorBaseRec);
cApp app = (Editor.Record as cApp);
string s = "";
if (app.apptype_id == null)
s += "n No appointment type was entered";
if (app.room_id == null)
s += "n No room was selected";
if (s != "")
{
if (!PSDevEx.cMessages.QuestionBox("Some information wasn't entered :-n" + s + "nnDo you still want to save this appointment?", "Confirmation Required"))
throw new PSExc.SilentException();
}
[4] Lastly click SAVE in the Script Editor and then close the window
(NOTE: do not click TEST SCRIPT as this will not work for the above script)
You should now find that you get an appropriate warning message if you miss out the Appointment Type and/or Room when saving an appointment.