How to warn if the Appointment Type and/or Room are missing?

Scripting help and sample scripts for use with the Scripting Module
Post a reply

How to warn if the Appointment Type and/or Room are missing?

Postby clinicoffice_user » September 8th, 2010, 1:27 pm

Hi,

When booking appointments, I’d like a warning if the operator has not completed both the appt type and the room number.

Thanks
clinicoffice_user
 
Posts: 55
Joined: July 20th, 2009, 8:47 am
Top

Re: How to warn if the Appointment Type and Room are omitted

Postby Support » September 8th, 2010, 1:43 pm

[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

Code: Select all
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 + "\n\nDo 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.
ClinicOffice Support Team
User avatar
Support
Site Admin
 
Posts: 875
Joined: August 25th, 2005, 6:37 pm
Top


Post a reply

Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest

cron