How to auto-lock Session Records as soon as they're saved?

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

How to auto-lock Session Records as soon as they're saved?

Postby Support » May 1st, 2012, 3:04 pm

[1] Click TOOLS | SCRIPT EDITOR to show the Script Editor screen
[2] Locate "frmClinicalNotes" and the "OnAfterSaveRecord" event
[3] Copy & Paste the following script into the Script Editor :-

Code: Select all
frmClinicalNotes frm = (Params[0] as frmClinicalNotes);
if (frm != null)
{
  if (frm.ActivePage.Record is cSess)
  {
    cSess sess = (frm.ActivePage.Record as cSess);
    sess.locked = true;
    sess.Save();
  }
  frm.RefreshData();
}

[4] Click OK

To test this out, try adding some SESSION NOTES and for a patient and then click the SAVE button. Notice that the session record is immediately locked after clicking save.
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 2 guests

cron