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
PremanathPremanath 

Unlock the Record using trigger

Hi,
 
I need small favor from you, help me on below issue please.
 
Requirement à In Approval Process quote(Object) records gets Locked Automatically, when the user approves . We want to unlock the record using Trigger.
 
Salesforce newly implemented method called unlock(recordsToUnlock), but it’s not  working as expected.
Ref: https://releasenotes.docs.salesforce.com/en-us/winter16/release-notes/rn_apex_approval_locks_unlocks.htm
 
  1.       I am updating the status field in Quote when user approves, from approval Process.
  2.       In debug logs it’s coming into the trigger, I guess record is locking after the trigger fires.
  3.       May be the problem with Order of execution.
 
Could you please help me, Is there any way to resolve this issue.
 
Thanks
Prem
 
RatanRatan
If you want to unlock the record when record is aaproved then there an steps in approval final steps to unlock the record.. 
PremanathPremanath
There are several Approval Steps before going to the final step. So i wanted to unlock the record on each step.
Jessica BabeJessica Babe
@premanath - did you ever figure this out? Want to unlock an opportunity once it is submitted for approval