Activity Forums Salesforce® Discussions can we lock record using SOQL so that it cannot be modified by other user.

  • can we lock record using SOQL so that it cannot be modified by other user.

    Posted by Anuj on May 1, 2020 at 1:38 PM

    how can we lock record using SOQL so that it cannot be modified by other user in Salesforce?

    Kirandeep replied 5 years, 9 months ago 2 Members · 1 Reply
  • 1 Reply
  • Kirandeep

    Member
    May 1, 2020 at 2:01 PM

    Hi Anuj,
    Yes we can lock record by using FOR UPDATE clause .
    like this :-
    Account[] accts = [SELECT Id FROM Account LIMIT 2 FOR UPDATE];

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos