0

I have lengthy validation rules for 6 fields, depending on Record type and subcategory. The rule is below. How do I exclude 4 users - so the rule does not apply to them? Thanks

 (
 (RecordType.DeveloperName  = "Passport"
&&
(
ISPICKVAL ( Subcategory__c , "Renewal")  || 
ISPICKVAL ( Subcategory__c , "New Issue") 
)
)
 || 
(
RecordType.DeveloperName = "Foreign_Travel_Contributed_Funds"
&&
(
ISPICKVAL ( Subcategory__c , "Passport only - New & Renewal") ||
ISPICKVAL ( Subcategory__c , "Passport with Visa Request") ||
ISPICKVAL ( Subcategory__c , "Visa Request" )
)
)
||
(
RecordType.DeveloperName = "Foreign_Travel"
&&
(
ISPICKVAL ( Subcategory__c , "Passport only - New & Renewal") ||
ISPICKVAL ( Subcategory__c , "Passport with Visa Request") ||
ISPICKVAL ( Subcategory__c , "Visa Request" ) 
)
)
)
&&
ISPICKVAL (Status__c , "Closed")
&&
ISBLANK (   Passport_Visa_Shipped_to_Location__c )
1
  • I was just working on editing this. Sorry. Feb 12, 2020 at 14:11

1 Answer 1

3

The best pattern for this type of validation rule exclusion is to create a Custom Permission, say BypassSubcategoryValidation.

Create a Permission Set and add the Custom Permission to it, but don't permission anything else. Assign the Permission Set to the four users you wish to exempt.

Then, in your validation rule, you can add a final criterion:

&& NOT($Permission.BypassSubcategoryValidation)

That would prevent the validation rule from evaluating to True (and therefore firing) for any user that has a Profile or Permission Set granting that custom permission.

You must log in to answer this question.

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