Excluding certain user from validation rule

If it is the userID you want to allow through, your validation rule will look like this:

IF(
 $User.Id == '00550000000lxVg', false,
 CONTAINS( TEXT(Client_Business_Type__c), 'Pension' ) && ISPICKVAL(Pension_Fund_Type__c, "")
)

What this does is evaluate the $User.Id, and if it matches the given on, simply returns false (which passes the Validation rule) otherwise (i.e for all other users) it goes on to evaluate your validation rule against the current criteria.

Obviously the hard-coding of ID values anywhere makes one shudder with the possibilities, but I am sure I too in the past have done this in Validation rules to allow certain Roles to skip them.

Incidentally in your question you do ask about a User ID being equal to something, and thenin your supposition you mention User Role Id - so make sure you have that bit clear in your mind too?

As an extra, you can "chain" these easy enough to "add" other users to the condition like this:

IF($User.Id == '00550000000lxVg', false, 
IF($User.Id == '00550000000lxWf', false, 
[...]
    CONTAINS( TEXT(Client_Business_Type__c), 'Pension' ) && ISPICKVAL(Pension_Fund_Type__c, "")
))

(remembering to close the relevant number of parentheses at the end) as the execution will just pass from IF to IF either escaping as false or moving on to the next evaluation.

Tags:

Validation