New answers tagged

5

The documentation you're looking for is Avoiding Deadlocks. As a developer, use care when locking rows to ensure that you are not introducing deadlocks. Verify that you are using standard deadlock avoidance techniques by accessing tables and rows in the same order from all locations in an application. To avoid problems, you must always lock any parent ...


3

Looking again at the locking documents (and reading the actual words FOR UPDATE), it says that a query with FOR UPDATE "Locks all records retrieved in SELECT statement that uses FOR UPDATE." It does not say that it locks any records related to those returned by the query. So, if I lock the EmailMessage, I should not expect it to lock the related ...


-2

have a custom field updated from the approval process and let it fire the trigger *In the trigger check for the condition of the updated field and call a future method with the unlock record code. *this ensures two transactions and it works! public with sharing class UnlockRecord { @future public static void Unlock(List<Id> requests) { ...


Top 50 recent answers are included