Record Locking
In Salesforce approval processes and Apex, the mechanism that locks a record to prevent edits while it is pending approval or being processed, ensuring data integrity during the approval workflow.
Definition
In Salesforce approval processes and Apex, the mechanism that locks a record to prevent edits while it is pending approval or being processed, ensuring data integrity during the approval workflow.
In plain English
“Record Locking in Salesforce approval processes and Apex is the mechanism that prevents edits to a record while it's pending approval or being processed. It ensures data integrity by keeping people from changing fields mid-workflow when that would cause problems.”
Worked example
When an employee at Brindle Solutions submits a $4,200 expense report for approval, the Record Locking mechanism kicks in: the expense record's fields become read-only for the submitter while the approval is pending. The employee can no longer change the amount, recategorize line items, or attach receipts mid-approval - those would corrupt what the manager is reviewing. Once the manager approves (or rejects) the request, the lock automatically releases. Without Record Locking, an employee could change the $4,200 to $42,000 after their manager approved it; with it, the platform guarantees the approver and the requester are looking at the same record.
Why Record Locking matters
In Salesforce approval processes and Apex, Record Locking is the mechanism that locks a record to prevent edits while it is pending approval or being processed, ensuring data integrity during the approval workflow. When a record is submitted for approval, Salesforce automatically locks it; the lock is released when the approval completes (approved or rejected) or when the submission is recalled. Administrators and certain profile permissions can override locks when needed.
Record locking prevents situations where fields change between submission and approval, which could invalidate the approval decision. If a manager approves a $10,000 discount request but someone edited the record to request $50,000 after submission, that would be a serious problem. Locking prevents this. Mature orgs understand record locking behavior and design approval workflows that account for it, including clear processes for edits that are genuinely needed during approval.
How organizations use Record Locking
Relies on automatic record locking during approvals to ensure data integrity.
Documents record locking behavior for their approval processes so users understand why edits are blocked.
Trains admins on record lock override permissions for edge cases requiring changes during approval.
Trust & references
Straight from the source - Salesforce's reference material on Record Locking.
- Classic Approval ProcessesSalesforce Help
Test your knowledge
Q1. What is Record Locking?
Q2. When is a record locked?
Q3. Can locks be overridden?
Discussion
Loading discussion…