[SalesForce] use the $Permission variable in a validation rule

I have an existing validation rule on a custom object that prevents users from selecting certain values in a picklist field, Stage__c, unless their user profile is equal to System Administrator' or 'Regional Director'. Is it possible to add an additional criteria to allow users with a given custom profile to also be exempt from this rule? My custom permission is $Permission.Design_Approver.

Current validation rule is:

AND( 
    NOT( $Profile.Name = 'System Administrator'), 
    $Profile.Name = 'Regional Director', 
    OR(ISCHANGED(Stage__c),ISNEW()) , 
    IF(ISPICKVAL(Stage__c, 'Design Win Production'),true,false) 
)

Best Answer

I was able to create a Custom Permission named "Test" and use $Permission.Test in my criteria without issue. You can't merge it in from the Insert Field button, but you can type it in.

$Permission.Test Validated

Note that you cannot do this with Permission Sets, only with Custom Permissions.

Custom Permissions

Related Topic