How to Easily Bypass Salesforce Flows with Custom Permissions

by Rijwan Mohmmed
0 comment
how-to-easily-bypass-salesforce-flows-with-custom-permissions-techdicer

Helloo folks!, We will explore How to Easily Bypass Salesforce Flows with Custom Permissions. Salesforce flows are awesome for automating business processes, but there are times when certain users or roles might need to skip these flows to handle special tasks or exceptions. When that happens, using custom permissions is a flexible and efficient way to make it work.

Also check this: Seamlessly Navigate to URL Addressable LWCs with Parameters in Salesforce

Importance of Bypassing Flows in Salesforce

Salesforce flows improve process consistency and reduce manual errors. However, there may be situations in which a flow is not applicable to all users or must be bypassed under particular conditions. For example:

  • Management Overrides: Certain users, like system admin, might need to bypass a flow to override its logic for troubleshooting or special cases.
  • Special Scenarios: Business processes sometimes require exceptions where the flow’s automation should not apply.
  • Role-Specific Processes: Certain roles might require the ability to bypass flows due to different responsibilities or access levels.

Step-by-Step Guide: Bypassing a Flow Using Custom Permissions and Permission Set in Salesforce

Step 1: Create a Custom Permission

  1. Navigate to Setup: In Salesforce, go to Setup by clicking the gear icon in the top right corner.
  2. Search for ‘Custom Permissions’: Use the Quick Find box to search for “Custom Permissions” and select it from the results.
  3. Create a New Custom Permission: Click the “New” button and define your custom permission. Give it a name that reflects its purpose, such as BypassFlow.

Step 2: Assign the Custom Permission to Profiles or Permission Sets

  1. Choose a Profile or Permission Set: Decide which profiles or permission sets should have the ability to bypass the flow.
  2. Assign the Permission: Navigate to the profile or permission set, go to the “Custom Permissions” section, and add the custom permission you created (BypassFlow).

Step 3: Modify the Flow to Check for the Custom Permission

  1. Open the Flow: Navigate to the Flow Builder and open the flow you want to modify.
  2. Add a Decision Element: Drag a Decision element into the flow, ideally at the beginning or where the bypass logic is needed. See below image
  3. Configure the Decision Logic:
    • Set up the decision criteria to check if the current user has the BypassFlow custom permission.
    • Use the Global Variables > $Permission to reference the custom permission in your decision logic.
    • Example: $Permission.BypassFlow is True.
  4. Set Up the Flow Paths:
    • If the custom permission is true, direct the flow to bypass the usual logic.
    • If false, let the flow proceed with its normal operations.

Custom Permission:

Flow with Decision element:

Decision element variable configuration:

how-to-easily-bypass-salesforce-flows-with-custom-permissions-techdicer-2

Step 4: Test the Flow Bypass

  1. Assign the Permission: Assign the custom permission to a test user profile or permission set.
  2. Run the Flow as Different Users: Test the flow both with and without the custom permission assigned to ensure that the bypass logic works as expected.

Benefits of Using Custom Permissions for Flow Bypass

  1. Flexibility: Custom permissions allow you to manage who can bypass a flow without altering the flow’s core logic or creating multiple versions of the flow.
  2. Scalability: As your organization grows, you can easily assign or revoke the bypass capability across different roles and profiles.
  3. Security: By using custom permissions, you ensure that only authorized users can bypass critical flows, maintaining the integrity of your business processes.

Output:

Reference:

  1. Flow Builder
  2. Custom Permissions

What’s your Reaction?
+1
1
+1
0
+1
0
+1
0
+1
0
+1
0

You may also like

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.