I am getting below error on a custom field on the Account
object during deployment.
unable to obtain exclusive access to this record
Why am I getting this error?
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityThis is because of record locking. From the Salesforce Developer site:
This is something temporary and would be fixed automatically in 10-15 minutes maximum.
Some common causes are:
- Sharing Rules are being calculated.
- A picklist value has been replaced and replacement is in progress.
- A custom index creation/removal is in progress.
- Most unlikely one - someone else is already editing the same record that you are trying to access at the same time.
Basically, whatever record it is that you're trying to manipulate is currently in use for the above reasons. Once it's no longer in use, it should become available for you to manipulate.
Without knowing what's in your Change Set however, there is one (painful) option from the Dev Boards:
The solution is to deploy different elements of your package in order until it is all complete. I've compiled a list of the components that I had to deploy, and put them in order. (I printed them up and put them on my desk... :P )
Anycomponents that you need to deploy that are not on this list, you can probably figure out how to make it work. If not, get in touch with SF support right away, and they'll get it worked out.
The list:
Deploy objects: Custom, and changes to any others. As well as any custom "help pages" (if any)
Deploy tabs, related documents, Applications
Deploy Triggers, and test Trigger classes
Controllers, test controller classes, components, related classes*
VF pages
Layouts
Email templates
Workflows
Reports
Dashboards
Long story short, if you haven't waiting and you're still getting this error. You might need to deploy metadata separately.
Edit After a bit of searching, I found this article.
It turns out that:
if you modify the format of an auto-number field - say, change the name from "C-{0000}" to "CDM-{0000}" - subsequent deployment of that object will fail if any test methods insert records of that object.
It seems what you need to do is:
Let me know how this goes.