---
schema_version: "1"
id: 26c1c2e688a290df6ae4d861f919b968a98eb8f2651c0a377c5e864387433a53
title: Lock Record Action
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/flow_ref_elements_actions_lockrecord.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.flow_ref_elements_actions_lockrecord.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: ac42ee5b55cf1fae5be98a97af3e4090472e10dc4d4511a8b502278e51dd27e4
description: Locks or unlocks a workflow-enabled or approval-enabled record for editing during an approval and specifies who can edit the record while it's locked.
products:
  - Flow Builder
  - Salesforce Platform
release: "264"
---
# Lock Record Action

Locks or unlocks a workflow-enabled or approval-enabled record for editing during an approval and specifies who can edit the record while it's locked.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_supported_editions.htm&amp;release=264.0.0&amp;type=5" title="Learn about the editions and user interfaces that support Flow Builder. Some Flow Builder features integrate with other Salesforce products that require additional licenses.">View supported editions.</a></td></tr></tbody></table>

In Flow Builder, add an Action element to your flow. In the New Action window, search for Lock Record, and then select **Lock Record**.

## Set Input Values

Use values from earlier in the flow to set the inputs for the action.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:24.509803921568626%">
          <col style="width:75.49019607843137%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d37191e81">Field</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d37191e84">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d37191e81 ">
              <strong class="uicontrol">Action</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d37191e84 ">
              <p>Required. Specifies the action to perform on the record. Valid values are:</p>
              <ul>
                <li>
                  <code>Lock</code>
                </li>

                <li>
                  <code>Unlock</code>
                </li>

              </ul>
            </td>

          </tr>
          <tr class="">
            <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d37191e81 ">
              <strong class="uicontrol">Record ID</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d37191e84 ">
              <p style="margin-bottom:0;">Required. The ID of the record to be locked or unlocked.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d37191e81 ">
              <strong class="uicontrol">Allowed ID</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d37191e84 ">Optional. The ID of a user, group, queue. or user role record that represents who can
              edit the record while it's locked.</td>

          </tr>
        </tbody>
      </table>

## Usage

This action is available in flows running in API version 61.0 and later.

To lock a record, a user or credentialed Experience Cloud site visitor requires view access to the record.

To edit a locked record, an allowed user or credentialed Experience Cloud site visitor requires edit access to the record, but system admins can always edit a locked record.

If a user role is specified for the Allowed ID parameter requires the user have a user role on or above the specified user role in the role hierarchy to be able to edit the locked record.

A group or queue specified for the Allowed ID parameter needs to be a group or queue of users or a group or queue of or credentialed Experience Cloud site visitors. The specified group or queue can’t contain:

- roles
- roles and internal subordinates.

An attempt to lock a record that’s already locked results in an error with the UNABLE\_TO\_LOCK\_RECORD error code.

A system admin, the user or credentialed Experience Cloud site visitor who locked a record, or someone who’s an allowed user for the locked record can unlock the record. An attempt by any other user results in an error with the INSUFFICIENT\_ACCESS\_OR\_READ\_ONLY error code.

The action completes without error when the action attempts to unlock a record that’s already unlocked.

## Limitations

If a record is locked with this action and the record is submitted to a classic approval process, then the classic approval process overwrites the record lock.

- If the classic approval process overwrites the lock from this action, then the allowed users specified by this action can no longer edit the record.
- The classic approval process can be interrupted when this action unlocks a record locked by the classic approval process.

#### See Also

- [Classic Approval Processes](https://help.salesforce.com/s/articleView?id=platform.what_are_approvals.htm&release=264.0.0&type=5 "It’s likely that you’re familiar with process automation in the form of workflow rules. Approval processes take automation one step further, letting you specify a sequence of steps that are required to approve a record.")