function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
prime kiprime ki 

Records Locking

i am traying to lock the records using SOQL(FOR UPDATE) Statement but it's not getting locked.In this two ways i am traying to lock the records 

1.Account [] accts = [SELECT Id FROM Account WHERE Name = 'SOQL' LIMIT 2 FOR UPDATE];

2.for (List<Account> Acc : [select id from Account  
   where Name = 'SOQL' for update]) {
    
}

Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Prime, hope it helps.

Please mark it as best answer if the information is informative.so that question is removed from an unanswered question and appear as a proper solution.

Thanks
Rahul Kumar