Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full Record Locking entry
How-to guide

How to configure record locking

There is no single switch named Record Locking. You configure it where the lock is created. For approvals, you set Record Editability on the approval process. For ad hoc locks, you use the Lock Record action in Flow. For code driven locks, you enable Apex locking. These steps cover the two most common admin paths.

By Dipojjal Chakrabarti · Founder & Editor, Salesforce DictionaryLast updated Jun 16, 2026

There is no single switch named Record Locking. You configure it where the lock is created. For approvals, you set Record Editability on the approval process. For ad hoc locks, you use the Lock Record action in Flow. For code driven locks, you enable Apex locking. These steps cover the two most common admin paths.

  1. Open the approval process

    Go to Setup, then Approval Processes, and select the process for the object you want. Click into its detail page where the steps and settings live.

  2. Set Record Editability

    Edit the process and choose either Administrators ONLY can edit records during the approval process, or Administrators and the currently assigned approver can edit records. Save your choice.

  3. Reactivate and resubmit if needed

    If the process was already active with records in flight, recall and resubmit those records so the new editability setting applies to them.

  4. Add a Flow Lock Record action for non approval cases

    In Flow Builder, add the Lock Record action, choose the record, and set it to lock or unlock. Wrap it in decision logic so it fires only when your status condition is met.

  5. Enable Apex locking if developers need it

    In Setup, open Process Automation Settings and turn on Enable record locking and unlocking in Apex so the Approval.lock and Approval.unlock methods work.

Key options
Record Editabilityremember

Controls who can edit a record while it is locked for approval: administrators only, or administrators plus the currently assigned approver.

Lock Record actionremember

A Flow element that locks or unlocks a chosen record outside of any approval process, driven by your own automation rules.

Enable record locking and unlocking in Apexremember

A Process Automation Setting that activates the Approval.lock and Approval.unlock methods for developer driven locking.

Gotchas
  • Changing Record Editability only affects records submitted after the save; recall and resubmit anything already pending.
  • Users with Modify All Data or Modify All Records can edit any locked record, so audit those permissions.
  • Apex lock and unlock calls count as DML, are blocked before callouts, and roll back with the transaction.
  • A SOQL query that uses FOR UPDATE cannot include an ORDER BY clause; sort in Apex instead.

See the full Record Locking entry

Record Locking includes the definition, worked example, deep dive, related terms, and a quiz.