UNABLE_TO_LOCK_ROW: unable to obtain exclusive access to this record
- Piotr Sałdan
- May 20
- 1 min read
Updated: Sep 15

Today I’d like to talk about triggers in Salesforce transactions — and what to do when you encounter blocking errors in your org, for example during integration with an external system.
One useful approach is to map your transaction logic. Start by listing the Flows and declarative automations (those you can build without code).
Then, draw out the logic that happens in the before and after triggers. Write down all database operations like insert and update, and indicate which ones occur inside the triggers or in the record-triggered flows in one chart.
Next, evaluate which of these operations can be performed asynchronously. If possible, move them to Queueable classes, or, if you’re dealing with higher scale, consider using Platform Events or Batch Apex.
🔴 Example error you might encounter:
UNABLE_TO_LOCK_ROW: unable to obtain exclusive access to this record or 1 records: a0B7X00000XXXXX
This error means that, during save, the system tried to update the same record simultaneously across multiple automations or integrations. This usually happens when there are too many synchronous operations occurring at once (like a Flow, Process Builder, Trigger, and API integration all trying to modify the same record).
✅ What can you do about it?
Analyze the entire transaction path and identify all synchronous automations.
Replace some of them with asynchronous logic using Queueable Apex or Batch jobs
Consider splitting operations into phases: for example, initial data capture first, then follow-up actions in a separate transaction.


Comments