Skip to main content
1 of 3
Adrian Larson
  • 151.3k
  • 38
  • 247
  • 431

There are a few approaches you can take here, which I will list in order of preference. These should work just about anywhere merge fields can be used.


Create a Custom Permission

You can check if someone has a Custom Permission in a formula as follows:

$Permission.My_Custom_Permission__c

Steps:

  1. Create Custom Permission
  2. Add it to a Permission Set
  3. Assign that Permission Set to any User you wish to exempt from validation

Hierarchy Custom Setting

If you don't find the above palatable for some reason, you can also check a Hierarchy Custom Setting in a formula as follows:

$My_Hierarchy_Setting__c.Is_Exempt_From_Validation_X__c

Steps:

  1. Create Hierarchy Custom Setting
  2. Add exemption field
  3. Set Org Wide Default for this field to false
  4. Set value to true for any User you wish to exempt from validation

Username

You can check against a Username in a way that at least works in all environments as follows:

BEGINS($User.Username, "[email protected]")

User Id

I would not use this unless you have compelling reasons none of the above are a good fit:

$User.Id = "00550000000lxVg"
Adrian Larson
  • 151.3k
  • 38
  • 247
  • 431