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
Praveen Kumar R 6Praveen Kumar R 6 

Any example code to use 'For Update' keyword to do record locking on a custom object?

I tried using the 'For update' keyword in apex controller SOQL query for locking the set of records of a custom object. But it's not working fine for me. Please share some example code for the keyword use case.
Praveen Kumar R 6Praveen Kumar R 6
@piyush,

Thanks for the details provided.
Can we try out the keyword in the apex controller where i call it from my 'Edit' button page for a custom object?
My scenario is to lock the records from the same time modifications by different users.