When I mass updating contact records. I am receiving UNABLE_TO_LOCK_ROW error.

Because I have a process it's updating a specific field in contact.When first name & last name <> null.

I know we can able to resolve this error if we have an issue in apex class with FOR Update keyword in soql query.

But, how to resolve if it firing because of a process.

  • How do you do the mass update? Data loader? – blank Jan 21 at 17:19
  • I tried using both workbench as well as data loader – Pavan tej Jan 21 at 17:54

I guess it's a one time operation, just update and forget, right?

Try sorting your contacts by Account. The thing is SF tries to lock parent record when you're updating a child, and the row which throws an error is actually a parent account for your contacts.

Another way is to use serial mode for data loader. The standard mode is parallel, which means it tries to execute all batches simultaneously. In serial mode it executes them one by one. It is slower, but helps you to avoid the error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.