Skip to main content

Record locking

The Medical Information Cloud Inquiry Management objects allow for the locking of records. This is accomplished via locking triggers (MED_LockRelatedRecordsHdlr and MED_LockRecordHdlr) that are enabled on an object (Account, Contact Information, and Affiliation) using the trigger action framework (TAF). Locking triggers are configured on the MED_Locked__c boolean formula field on each of the objects. In cases where a record’s MED_Locked__c formula evaluates to true, the system prevents the following actions:

  • Editing of the record itself

  • Deleting/Editing of related Files and Attachments

  • Deleting/Editing of Chatter Posts

  • Adding new versions of related Files

  • Removing File associations

  • Deleting of related Notes

If using trigger action framework, individual objects can be configured such that locking can be enabled or disabled using the Trigger Action (mvn__TAF_Trigger_Action__mdt) custom metadata type and the appropriate MED_LockRelatedRecordsHdlr (if locking is controlled by a parent object) or MED_LockRecordHdlr if locking is controlled by itself.

Locking rules (what fields on what objects define "locked" in addition to the error messages) can also be customized by creating a Callable class and specifying it in the Global Setting (mvn__MED_Global_Settings__mdt) Locking Rules Class (mvn__MED_Locking_Rules_Class__c) field setting. To make your own. class, clone the MED_LockingRulesHdlr class and modify it as needed.

Enabling record locking

By default, the records are configured to be locked when their MED_Source__c is not Medical Information Cloud (for Accounts) or MED_Is_Closed__c/IsClosed is checked (for other objects). This logic can be altered to meet specific requirements.

Note

Users with the Bypass Validation custom permission will not be subject to the record locking.

Note

Code can also bypass the locking by setting MED_Override_Lock__c to true as part of the transaction.

Disabling record locking

Locking can be disabled on any of the above mentioned objects by simply changing the formula to return false. For Medical Information Cloud V15, you can also disable them by checking the checkbox in the Bypass Execution (mvn__TAF_Bypass_Execution__c) field on the Trigger Action (mvn__TAF_Trigger_Action__mdt) metadata record.

Custom labels

This component makes use of the following labels that can be configured within the Salesforce translation workbench to change display text values.

Label name

Description

MED_Attachment_Parent_Closed

Generic error message displayed when editing/deleting Files or Attachments on a locked record.

MED_Cannot_Modify_Record_on_Closed_Case

Error message displayed when editing/deleting Files or Attachments on a locked Case.

MED_Cannot_Modify_Record_on_Closed_Fulfillment

Error message displayed when editing/deleting Files or Attachments on a locked Fulfillment.

MED_Record_is_Locked

Generic error message displayed on record if it meets the locked criteria.