Bypass Specific Triggers or Validations

Configure a policy to bypass only the specific triggers or validations that you select.

Required Editions

Available in: Developer, Enterprise, Performance, and Unlimited Editions. Requires the Privacy Center license.
User Permissions Needed
To create, edit, and schedule privacy policies: Manage Privacy Center Policies

Task overview:

To complete this setup, you add a custom permission to the trigger or validation rule that you want to bypass. Make sure that the trigger or rule is bypassed when the running user has the specified permission. You then grant the permission to the system user that runs the privacy policy.

Note
Note The Automated Process User runs privacy policies by default. When you assign a permission set to a policy, the Platform Integration User runs the policy instead. Only the Platform Integration User has the necessary bypass privileges.

Step 1: Modify the Trigger or Validation Rule with a Custom Permission

Add a custom permission as a bypass condition to the triggers and validation rules that you want to bypass.

  1. Create a custom permission.
  2. Optional: To bypass a record-triggered flow, you can use a Decision element with the Running User’s Permission resource as a condition. For example, {!$Permission.custom_permission_name} Equals {!$GlobalConstant.True/False}.
  3. Optional: To bypass a validation rule, you can add the custom permission to the error condition formula as a NOT condition. As a result, the formula evaluates to true only when the user lacks the custom permission.
  4. Optional: Add the custom permission to any Apex triggers that you want to bypass.

Step 2: Assign the Custom Permission via a Permission Set

Turn on the custom permission that you created on a permission set, and assign the permission set to your privacy policies.

  1. Add the custom permission to a new permission set. Make sure that the permission set is session-based by enabling the Session Activation Required setting.
    Note
    Note The permission set must include only the custom permission that you created for bypassing triggers and validation rules. If other user permissions are present, errors can occur with your configuration.
    Related topics:
  2. From Setup, in the Quick Find Box, enter Privacy Policy, and then select Privacy Policy Settings.
  3. Under Automation Settings, turn on Designate a permission set for policy execution users.
  4. In the Select a Permission Set field, start typing the name of the permission set, and then select it.
  5. Save your changes.
  6. Go to the Privacy Center app and select a policy.
  7. Click Edit.
  8. Under Permission Set Assignment, turn on Assign permission set to policy execution user: <permission set name>.
  9. Save your changes and republish your policy.