-1

I need to be able to have certain Opportunity fields to remain locked during the Approval process?

There are few Opportunity custom fields which I need to keep locked during the Submit for Approval process even when the Unlock Opportunity record button is pressed.

Could you please explain how this can be achieved in Salesforce?

Thank you

closed as off-topic by Adrian Larson, Sebastian Kessel, Vigneshwaran G, Boris Bachovski, Mohith Shrivastava Oct 21 '16 at 0:12

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on problems in code you've written must describe the specific problem and include valid code to reproduce it. For help writing short, self-contained syntactically-valid examples, see: SSCCE.org" – Adrian Larson, Sebastian Kessel, Vigneshwaran G, Boris Bachovski, Mohith Shrivastava
If this question can be reworded to fit the rules in the help center, please edit the question.

0

You can do this using an additional record type and a page layout, along with a validation rule to prevent edits via the API.

When record submits for approval, you can add a field update that will update the record type to a new one, call it "locked"

Create a page layout and mark these fields as read only, and assign this page layout to the locked record type.

Note that this is superficial security. The field is still editable via the api. So it's not truly secure.

So I suggest also adding a validation rule that prevents editing of these fields based on the value of record type or of another field that is updated by the approval process.

You could just do the validation rule, which would prevent edit, but would not be as good for the user as the fields would appear to be editable until they tried to save. For this reason I recommend flipping the record type, but that decision will depend on your use case and preference.

Not the answer you're looking for? Browse other questions tagged or ask your own question.