6

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) 
)
1
  • 1
    Note that IF(ISPICKVAL(Stage__c, 'Design Win Production'),true,false) is syntactically equivalent to ISPICKVAL(Stage__c, 'Design Win Production'). Save yourself some typing (and character limits)!
    – Adrian Larson
    Commented Jun 8, 2015 at 20:18

1 Answer 1

6

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

4
  • Sorry I checked under merge field alone. Deleting answer.
    – Victor
    Commented Jun 8, 2015 at 20:21
  • Yeah you can't "find" it, but if you know it's there, you can use it. :)
    – Adrian Larson
    Commented Jun 8, 2015 at 20:26
  • 1
    I created a custom permission called DWApporver but when I add it to my formula using '$Permission.DWApprover' I get an error that says "Field DWApprover does not exist. Check spelling." What am I doing wrong?
    – KShannon
    Commented Jun 8, 2015 at 20:46
  • 1
    Did you create a Permission Set or Custom Permission? Permission Sets won't work.
    – Adrian Larson
    Commented Jun 8, 2015 at 20:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .