You need to sign in to do that
Don't have an account?

UNABLE_TO_LOCK_ROW: unable to obtain exclusive access to this record or 1 records:
We constantly receive this error message for some of our flows and I'm not sure where to start with debugging it. The record ID referenced in the flow error email is always a record (not always the same one) that is a lookup field on one of the records to be created as part of the flow. Not really sure what info you folks need to assist me, let me know and I will post ASAP.
What flow are you using to update the record? Is it a future method call, queueable or a batch process?
The reason of this error is to update same record by more than one transaction. Whenever a record is updated, salesforce places a lock on that record so that it could maintain data consistency and same record didn't get updated at the same time by some other transaction.
In case of master-detail relationship, if we update detail record, it also locks a child record. So if you are updating child records of same master in different transactions, this may also lead to UNABLE_TO_LOCK_ROW error.
Here you can find more detail of this error - https://help.salesforce.com/articleView?id=000229525&type=1
To start debugging the issue, create debug logs and also check Apex Jobs at the same time. Apex job will have asynchronous calls in your flow and must have some DML which is updating same record on which you are getting UNABLE_TO_LOCK_ROW error. You need to check both the updates, the update on which you are facing UNABLE_TO_LOCK_ROW error and the asynchronous method or class which is updating the same record. Please let me know in case of any concern.
Thanks,
Anjita
If you are able to reproduce the issue, then Apex jobs and Debug logs will help you to figure out the two DML calls on the same record. Apex jobs will have an asynchronous call which is already running and has put a lock on the record. You try to update the same record in your code and gets UNABLE_TO_LOCK_ROW error as the record is already locked. You just need to get the locked record Id and find out the second flow which is updating this record at the same time.
You can also check best practices to avoid this issue at https://help.salesforce.com/articleView?id=000229525&type=1. Please feel free to revert back if you have any query.
Thanks,
Anjita