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.
- 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.
- 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.
- 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.
- 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.
- 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.
Controls who can edit a record while it is locked for approval: administrators only, or administrators plus the currently assigned approver.
A Flow element that locks or unlocks a chosen record outside of any approval process, driven by your own automation rules.
A Process Automation Setting that activates the Approval.lock and Approval.unlock methods for developer driven locking.
- 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.