Skip to main content
added 124 characters in body
Source Link
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

UsernameAlias

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

$User.Alias = "analias"

Username

Somewhat less clean than Alias, but you would check against a Username as follows:

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

User Id

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

$User.Id = "00550000000lxVg"

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 adopt this approach unless you have compelling reasons none of the above are a good fit:

$User.Id = "00550000000lxVg"

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

Alias

You can check against an Alias in a way that in all environments as follows:

$User.Alias = "analias"

Username

Somewhat less clean than Alias, but you would check against a Username as follows:

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

User Id

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

$User.Id = "00550000000lxVg"
added 11 characters in body
Source Link
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 useadopt this approach unless you have compelling reasons none of the above are a good fit:

$User.Id = "00550000000lxVg"

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"

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 adopt this approach unless you have compelling reasons none of the above are a good fit:

$User.Id = "00550000000lxVg"
Source Link
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"