Pages

Monday, January 22, 2018

Implementing Custom Permission for Workflow and Process Builder

More than 3 years ago, we wrote a blog on implementing Custom Permission for Validation Rules. In this blog, we are going to share the same Custom Permission, but for automation, including Workflow and Process Builder.

We'll not discuss further on how to create Custom Permission and Permission Set, so please check the blog mentioned earlier if you need a reference to create Custom Permission and Permission Set.

Workflow
From Workflow Rule Criteria, select formula evaluates to true.
If you have Custom Permission created, you will see $Permission > under Insert Field.



In this sample, I have a Custom Permission name "Edit_Customer_Custom_Permission", select that permission and add it to Rule Criteria $Permission.Edit_Customer_Custom_Permission.



With this criteria, only users assigned to the Permission Set will trigger the workflow, otherwise, the workflow will not be fired.

Process Builder
Let's use the same Custom Permission - Edit_Customer_Custom_Permission. From Criteria - "Define Criteria for this Action Group"
1. Select Formula evaluates to true.
2. In the Build Formula panel, click System Variable.


3. Select Permission >


4. Type or select the Custom Permission, click Choose button.



5. Now you have the formula built $Permission.Edit_Customer_Custom_Permission.



This is the same criteria with Workflow criteria's above.


ReferenceCustom Permission for Validation Rule



No comments:

Post a Comment

Page-level ad