About this question
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?
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?
Log in to share your answer and help other learners.
Log in to answerBest Answer · By JanBask Salesforce Expert
Answered on May 24, 2024
You are getting this error - unable to obtain exclusive access to this record 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... )Any Components 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
DashboardsLong story short, if you haven't been waiting and you're still getting this error. You might need to deploy metadata separately.
Best Answer · By JanBask Salesforce Expert
Ranjana Admin JanBask Expert
Answered on May 24, 2024
The error message "Unable to obtain exclusive access to this record" typically occurs in database systems when there is a concurrency issue, meaning multiple processes or transactions are trying to access or modify the same record simultaneously, but only one can do so at a time.
Here are some common reasons why you might encounter this error and how to address it:
Concurrency Control: Database systems use various concurrency control mechanisms to handle simultaneous access to data. Check if your database system supports locking mechanisms like row-level locks or transactions. Ensure that your code is properly managing transactions and locking resources when necessary to prevent concurrent modifications to the same record.
Transaction Isolation Levels: If you're using transactions, ensure that you're setting the appropriate isolation level to control the visibility of changes made by other transactions. Depending on your application's requirements, you may need to adjust the isolation level to prevent conflicts.
Optimistic Concurrency Control: Consider using optimistic concurrency control techniques if appropriate for your application. With optimistic concurrency control, instead of locking records during the entire transaction, you check for conflicts before committing changes. If conflicts are detected, you can handle them by retrying the transaction or notifying the user.
Application Design: Review your application's design to minimize the likelihood of concurrency issues. Ensure that transactions are kept short and that data access patterns are optimized to reduce the chances of conflicts.
Error Handling: Implement robust error handling in your application to handle concurrency-related errors gracefully. When this error occurs, provide informative error messages to users and consider offering options such as retrying the operation or notifying administrators.
Database Configuration: Check if there are any configuration settings in your database server that might be contributing to the issue, such as maximum connections or timeouts. Adjust these settings as needed to accommodate the workload and concurrency requirements of your application.
Monitoring and Debugging: Set up monitoring tools to track database activity and identify potential concurrency issues. Use logging and debugging tools to trace the flow of transactions and identify any areas of contention.
By addressing these potential causes and implementing appropriate solutions, you can mitigate the "Unable to obtain exclusive access to this record" error in your application.
Berniecereynolds Latest answer
Answered on Apr 10, 2025
Temporarily deactivate any Process Builder, Flow, trigger, tunnel rush or workflow related to the Account object if you suspect they are gaining access. Once deployed, you can reactivate.
Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.
Step-by-step Salesforce guides from industry experts
Common Salesforce interview questions, answered
Guides, tips and career advice on Salesforce from JanBask experts.
Salesforce How to Become a Salesforce Administrator in 2027: A Step-by-Step Career Roadmap
Want to become a Salesforce Administrator? Get the complete 2026 roadmap skills, certification, salary & career path. Start your…
Salesforce Salesforce Admin Self Study vs Live Training: How to Choose the Right Path
Compare Salesforce Admin self-study and live training by cost, duration, flexibility, mentorship, and career support. Find the…
Salesforce How a Salesforce Admin Certification Shapes Your Career Growth
Wondering if a salesforce admin certification is worth it? See how it shapes hiring, salary, and long term salesforce admin…
Salesforce Salesforce Admin vs Developer Salary: Which Path Actually Pays More?
Salesforce admin vs developer salary: developers earn 15–25% more. See entry, mid and senior pay, why the gap exists, and how…