Overview:
Upon running the Veeva CRM Multichannel Cycle Plans (MCCP Calculation) Job in the Veeva Process Scheduler of Veeva CRM, the following errors can be seen in the View Result files of the MCCP Related objects of the Bulk Data Load Jobs section:
UNABLE_TO_LOCK_ROW: unable to obtain exclusive access to this record or x records
Root Cause:
This is a standard Salesforce error implying that the affected record is in use and it cannot be updated by the job.
The issue in case of MCCP data may be caused by custom Roll-up Summary fields located in any of the OOTB MCCP related objects. They are not supported due to the following Salesforce behaviour concerning these fields. This scenario is considered an SFDC platform limitation from the perspective of Veeva.
Summary fields defined at master object level can cause the lock exception. More details about the behaviour can be found in these pieces of Salesforce documentation:
- The Salesforce Bulk API - Maximizing Parallelism and Throughput Performance When Integrating or Loading Large Data Volumes
- Record Locking Cheat sheet
Solution:
Remove, Hard Delete the Custom Roll-Up Summary fields located in the OOTB MCCP related objects and Clear the Veeva Cache.
A solution is to have one Apex Scheduled class perform these Roll-up calculations instead.
Related Documentation:
CRM Help Documentation:
Salesforce Documentation:
- The Salesforce Bulk API - Maximizing Parallelism and Throughput Performance When Integrating or Loading Large Data Volumes
- Record Locking Cheat sheet
Knowledge Article: