Loading
Salesforce now sends email only from verified domains. Read More
Automate Your Business Processes
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Record Locking in Flow Approval Processes

          Record Locking in Flow Approval Processes

          Record locking controls who can change a record associated with an in-progress approval submission. The way you implement record locking depends on whether the approval steps in a flow approval process stage run consecutively or concurrently.

          Required Editions

          View supported editions for Flow Approval Processes.

          Lock the Record for Consecutively Run Approval Steps

          When the approval steps in a stage run sequentially, use the Lock the record setting in the Select Where to Complete the Action section of the Approval Step properties panel. Also use this setting if your flow approval process contains a series of stages, each stage containing only one approval step.

          Lock the Record for Concurrently Run Approval Steps

          A record can have only 1 lock on it at a time. Trying to lock a locked record again causes an error in a flow approval process. This limitation means that you can’t use the Lock the record setting when a flow approval process contains approval steps that run concurrently. Deselect the setting and instead manage record locking at the flow approval process or stage level. When you have a flow approval process stage that contains multiple approval steps running at the same time, use background steps to manage record locking.

          Managing record locking at the flow-approval-process level or stage level requires an autolaunched flow containing an Action element that references the Lock Record action. This flow has 2 required inputs and 1 optional input. The first required input, Action, specifies whether to lock or unlock the record. The other required input, Record ID, is the ID of the record under review. The optional input, Allowed ID, is the ID of a user, group, queue, or user role record that represents who can edit the record while it’s locked.

          Flow-Approval-Process-Level Locking. To manage record locking at the flow approval process level, add 2 stages to your flow approval process, each containing a background step to manage record locking.

          Add the first stage before any stages that contain approval steps. The step in this stage calls an autolaunched flow that locks the record to be approved, setting the Action input to Lock and the Record ID input to the ID of the record under review.

          Add the second stage after the last stage that contains approval steps. This step in this stage unlocks the record to be approved, setting the Action input to Unlock and the Record ID input to the ID of the record under review. This stage can also be added to stages that process final approval actions and final rejection actions.

          Stage-Level Locking. To manage record locking at the stage level, add 2 background steps to a stage that contains approval steps that run concurrently.

          Add the first background step and configure it to run when the stage starts. This step calls an autolaunched flow that locks the record to be approved, setting the Action input to Lock and the Record ID input to the ID of the record under review.

          Configure each approval step in the stage to require the background step that locks the record to be marked as completed before each approval step can start.

          Add the second background step to the same stage. This step calls an autolaunched flow that unlocks the record to be approved, setting the Action input to Unlock and the Record ID input to the ID of the record under review. The entry condition to select for this step depends on how many concurrent approval steps are in the stage.

          If there are 10 or fewer approval steps, select When the specified requirements are met entry requirement, the step starts. Then add requirements so that the step starts only when the status of each approval step in the stage is Completed.

          If there are more than 10 approval steps, create an evaluation flow that contains an input variable for the status of each approval step in the stage. In the evaluation flow, set the isOrchestrationConditionMet output variable to True. Otherwise set the output variable to False. Then configure the entry condition for the second background step. Select When the specified evaluation flow returns True, the step starts and specify the name of the evaluation flow. For each input, pass the automatic output for each approval step’s status.

          When to Allow Edits to a Locked Record

          Record locking during a flow approval process prevents changes to a record while it's under review. A Salesforce admin, however, can edit records locked by an approval process.

          Normally, an approver doesn’t change the record that’s associated with an in-progress approval submission. The approver or their delegate approves or rejects their approval work item based solely on the record provided by the person who submitted the approval.

          You can, however, introduce an approve-with-changes scenario into your flow approval process. A high-level approver can make changes to a record that's associated with an in-progress approval submission. The drawback to an approver changing a record under review is that an approval submission has no approved-with-changes status. To know that changes were made by the approver, you rely on the approver adding details about the changes they made in their approval comments.

          You can allow the editing of a locked record with all methods of record locking. Regardless of the method, only an assigned approver, not their delegate, can edit the locked record.

          When approval steps run consecutively, use the Allow approver to edit the locked record setting in the Select Where to Complete the Action section of the Approval Step properties panel. When this setting is selected, any approver assigned the step can edit the record.

          When approval steps run concurrently, update the background step that locks the record under review. Set the Allowed ID input of this background step to the ID of the user, group, queue, or user role that can edit the record while it’s locked. No change is required for the background step that unlocks the record.

           
          Loading
          Salesforce Help | Article