Another Salesforce blog!!!

Salesforce, Apex

lock record using SOQL so that it cannot be modified by other user


we will need “FOR UPDATE” clause of SOQL.

Account[] accts = [SELECT Id FROM Account LIMIT 2 FOR UPDATE];

Leave a Reply

Your email address will not be published. Required fields are marked *

*