function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
PhryPhry 

Validation Rule applying to specific users

Hello,

 

                I'm looking for a little help with a validation rule. So far i have the following rule.

 

ISPICKVAL( Resolution_Type__c ,"Trouble")
&&
NOT(ISPICKVAL(Status ,"Working")
)

 

Which when Trouble is chosen from picklist then the case status has to be set to working in order to save. This is working great.

 

Now i'm looking to make this rule apply only for three individual users. I know i can use $User.Id <> "###" to specify some users but i'm just not sure on the syntax to make it work with the rest of the rule and make the rule only trigger for these specific users.  Any help would be greatly appreciated.  Thanks Mike

Best Answer chosen by Admin (Salesforce Developers) 
PhryPhry

Thanks!   I made a few changes to what you provided to get it to work properly, here's what i ended up with that appears to be triggering correctly only for the specific users i include in the rule.  Thanks for the help, Mike

 

(ISPICKVAL( Resolution_Type__c ,"Trouble")
&&
NOT(ISPICKVAL(Status ,"Working"))
&&
$User.Id=="user1"||$User.Id=="user2"
)

All Answers

sfdcttslsfdcttsl

ISPICKVAL( Resolution_Type__c ,"Trouble")
&&
NOT(ISPICKVAL(Status ,"Working")

&&

(User.Id=='...'||User.Id=='...'||User.Id=='....')
)

 

Please try this...

PhryPhry

Thanks!   I made a few changes to what you provided to get it to work properly, here's what i ended up with that appears to be triggering correctly only for the specific users i include in the rule.  Thanks for the help, Mike

 

(ISPICKVAL( Resolution_Type__c ,"Trouble")
&&
NOT(ISPICKVAL(Status ,"Working"))
&&
$User.Id=="user1"||$User.Id=="user2"
)

This was selected as the best answer