12 réponses
Hi Amrender,When you have multiple jobs running that update the same set of records, it's recommended to lock the records using the FOR UPDATE keyword. It will ensure that the record is locked and no other job can update the same record at that point in time. The conflicting job will then wait untill the locking on the record is released and then perform the required operaiton. This will avoid conflicts between jobs that are running concurrently and will not throw up this exception. You can refer the below link to learn more about record locking.https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_locking_statements.htmkindly mark it as an answer if that resolves your query !