Skip to main content
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.
5 risposte
  1. 8 giu 2017, 18:33
    Hi Erik,

    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