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
GMASJGMASJ 

How to lock record

Hi, 

  I want to create a record lock when "Opportunity stage is StageEQUALSClosed Lost,Closed Other,Closed - Cancelled,Closed Other Renewal,    record must be locked, except for system administer profile.  Please suggest me how to do record lock when this conditions are met. 

Thanks
Sudhir
S95S95
Hi GMASJ,

please do refer  :
http://www.asagarwal.com/how-to-lock-records-in-salesforce/
http://releasenotes.docs.salesforce.com/en-us/winter16/release-notes/rn_apex_approval_locks_unlocks.htm#rn_apex_approval_locks_unlocks
You can make use of record Types,Trigger so as to lock a record when certain conditions are met.

Thanks,
Sruthi
 
SHAHNA MULLASHAHNA MULLA
Hi Sudhir,

Try this code in the Validation Rule of your Opportunity,
AND(
   CASE(
        Stage,
       'Closed Lost ', 1,
       'Closed Other ', 1,
       'Closed - Cancelled ', 1,
       'Closed Other Renewal ', 1,
        0
      ) =1
)
And check following link : https://success.salesforce.com/answers?id=9063A000000iTpEQAU

Can you please Let me know if it helps or not!!!

If it helps don't forget to mark this as a best answer!!!
MUHAMMED SEMIN P NMUHAMMED SEMIN P N
Hi sudhir,
we can lock record using process builder  when certain conditions are met, you can use process builder for  solving your problem. 
please go through below link
https://thewizardnews.com/2015/12/10/auto-lock-records-with-process-builder/
hope this will help you,
If it solve your problem please mark it as a best answer
thanks