Locking records

You can lock individual records to prevent users from editing or deleting them. To use this feature, enable the Lockable attribute in the object definition. Records of that type will have an Is Locked check box. If you enable the attribute on an existing object definition, you need to edit views and pages, such as the new record page, to include the new attribute.

The Is Locked checkbox can be set to locked by directly editing a record, or by using a mass update or trigger — any mechanism that updates records. A new Trigger Type - > Update Field Value with Trigger Name - > Set Lock is created when you enable the Lockable attribute. To remove locks on multiple records, use a trigger or an API call to set the Is Locked checkbox to false.

When you lock a record, it has the following effect:

  • Edit and delete controls on the record's view page are disabled.
  • The Is Locked field displays a closed lock icon.
  • Fields for related objects on the record's view page do not display links to create, attach, edit, or delete related records.
  • Edit and delete controls for the locked record on related record view pages are disabled.

Workflow actions are still available when a record is locked. If you want to disable workflow actions on locked records, add a condition formula to each workflow action you want to disable. The formula returns false if the record is locked.

To add a condition formula to a workflow action:

  1. Navigate to the workflow action from the object definition.
  2. Click Edit.
  3. In the Action Condition Formula section, enter the following formula:

 !{!isLocked}