Record Locking

All About Record Locking in Salesforce

In this blog entry, I'd examine the various approaches to secure a Salesforce record UI. By lock, I mean, the client shouldn't have the option to alter the field estimations of the record. I have distinguished 3 different ways to bolt a record utilizing b

There is an overall necessity that the business doesn't need any client to alter any fields of an Opportunity record when it is in the 'Finish' stage or 'Arrangement Closing' stage or in any event, whenever the open door is 'Shut Won'. Not simply opportunity, it very well endorsement cycle be any article (standard/custom) here and there the business doesn't need the client to alter a record when it is in a specific phase of the business/business measure

There is no "best" approach among these 3, each approach has its own upsides and downsides. The methodology you pick simply relies upon what suits your necessity. I will feature the upsides and downsides for every one of these methodologies, with the goal that it encourages you to settle on a more astute choice.

dont miss out iconDon't forget to check out: How to Import Salesforce Custom Metadata Records using CSV/JSON

Record Types and Workflow-Process Builder

In this methodology, you need to make 2-page formats. I'm calling them – "EditablePageLayout" and "ReadOnlyPageLayout". The editable page design is the current ordinary page format you as of now have. The read just page format will have all the fields in read-just mode i.e., for each field in this page design, you need to tap the settings symbol and check the 'Read Only' check box as demonstrated as follows. 

When you have the page formats prepared, make 2 record types and relegate the page designs to the record types. 

Presently make a work process rule – whenever the open door stage is in "Exchange/Review", we need to change the page format from EditablePageLayout to ReadOnlyLayout. To change the page format, we need to change the record type for that record utilizing the work process. Here's the way the work process resembles.

Visualforce Page

This is a more monotonous approach to bolt a record. You need to abrogate the standard catches Edit and View with a Visualforce page. The Visualforce page can utilize a tag to duplicate the whole page format (and cripple Edit catches on the page) OR utilize singular labels for the fields to fabricate the page without any preparation. No client would have the option to alter outputField values

Note: The burden with this methodology is keeping up the VF page. In the event that you'd need to add fields to the page format, you need to alter the VF page and add the code for each new field.

Approval Process

Another approach to bolt a record is utilizing an Approval Process. The locking highlight is a standard element given by Salesforce and the whole record will be bolted. All things considered, the entire motivation behind the Approval Process isn't tied in with locking, it is about how records are endorsed in Salesforce. An endorsement cycle indicates each progression of endorsement, including who to demand endorsement from and what to do at each purpose of the cycle. We are simply utilizing an Action from the Approval Process. 

dont miss out iconCheck out another amazing blog by Aditya here: Salesforce Integration with Postman - The How-to Guide

Anyway, how to bolt a record utilizing the endorsement cycle? Basically, you simply need to set up an Approval Process for an item and set the rules for the record to enter the endorsement cycle (In our model, the measures for the Opportunity stage is 'Exchange'). When you set the underlying standards, the Initial Submission Action will incorporate Record Lock.


Popular Salesforce Blogs