Viewing 1 post (of 1 total)
  • Author
    Posts
  • #31645
    Support
    Keymaster

    Here are two examples :-

    This first example will show how to make the ROOM field mandatory on the Appointment Editor.

    [1] Click TOOLS | SCRIPT EDITOR to show the Script Editor screen

    [2] Locate “frmEditorApp” and the “OnBeforeSaveRecord” event

    [3] Copy & Paste the following script into the Script Editor :-

    frmEditorBaseRec Editor = (Params[0] 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.

     

    This second example will show how to make the REFERRED BY field mandatory on the Patient Editor.

    [1] Click TOOLS | SCRIPT EDITOR to show the Script Editor screen

    [2] Locate “frmEditorPatient” and the “OnBeforeSaveRecord” event

    [3] Copy & Paste the following script into the Script Editor :-

    frmEditorBaseRec Editor = (Params[0] as frmEditorBaseRec);
    
    cPer per = (Editor.Record as cPer);
    
    if (per.referredcat_id == null)
    
    {
    
    throw new PSExc.FriendlyException("Please select a REFERRED BY category for this Patient", "'Referred By Category' is Required");
    
    }

    We hope this is helpful! Please feel free to post a reply if you have any questions or need something to be clarified!

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.