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
ssssssssssssss 

Unlock records for certain users during approval process

Hi,


I have a multi step approval process in place for Opportunity object.
The record gets locked When the opportunity is submitted for approval.
There is a group of users which needs to edit the opportunity records, irrespective of what the stage is. They should be able to edit the fields whether they are just submitted for approval, or in approved stage.

If we unlock the record during approval, it would be editable by all the users. But we need to restrict the editable property only to that particular group pf users.


Please let me know if you know of any method which can do this..or let me know if you need to know anything else.

 

Thanks.
Sumit

 

Vinita_SFDCVinita_SFDC

Hello,

Unfortunately at present there is no means by which we can work on locked records, submitted for approval. There is an idea on ideaexchange portal for unlocking records with Apex, would suggest you to vote this idea:

https://success.salesforce.com/ideaView?id=08730000000BrZOAA0

There are only two ways a record can be unlocked that is locked by the approval process.

    1) The 'Final Approval Action' of the process does have the feature to unlock a record.
   2)  A button labeled 'Unlock record' will be visible (only)to system administrators and only they can unlock a record locked by an approval process.

Kelley MinorKelley Minor
I'm sure you've already figured out a work around, but I wanted to let you know what we've done to unlock records for users.

We created different record types -- for example, a standard record type, and a read-only record type.  For each record type, we've assigned a specific page layout.  For the R/O record type, we created a page layout and locked down all the fields to be read only.  Then, upon submitting for approval, we can set the record to unlocked but flip the record type to the R/O one.  The users don't know any different.  It looks like the approval process has locked down the record.  But for certain profiles, we have the page layout set to the standard (editable) one for all the record types.  So while my users can't edit the record, I can.  And I can give other profiles the power to do so, as well, if needed.

Hope that helps someone!
sfdc2705sfdc2705
Hi Kelley,

Then, upon submitting for approval, we can set the record to unlocked but flip the record type to the R/O one
How would you flip the record type to the readonly one..Please give few more details on how to flip automatically bases on the approval process.

Appreciate any help..

Thanks
Mukesh Kumar 107Mukesh Kumar 107
Step:
1. Unlock the record through Apex Code (find your own way to call this Apex Code)
2. Use a flag to indicate if Approval Process is still in Pending state.
3. Use a validation rule based on the flag & PublicGroup/Something to throw an error message if someone tries to edit the record.