[SalesForce] Restrict access to picklist value to specific users

Disclaimer: I am rather new to Validation Rules (and Salesforce in general) and GREATLY appreciate any assistance this community could offer

I am attempting to lock down 3 picklist items from the Account Type picklist so that only 4 specific users can select these values using Validation Rules.

In the past, I was able to accomplish something similar in Opportunity using Validation Rules, but the need only called for the restriction of 1 value. I'm having issues with migrating this syntax to handle multiple values.

Here is my current syntax that isn't working:

AND( 
$User.Id <> "0051N000005giDN", 
$User.Id <> "0051N00000696tX", 
$User.Id <> "0051N000005gi5T", 
$User.Id <> "0051N000005EMyk", 
ISPICKVAL(Type,("Partner", "Partner Customer", "Direct Customer")))

Best Answer

ISPICKVAL(picklist_field, text_literal) can only compare the field's value to a single text literal.

You will need to change your formula as:

AND( 
...

    OR(
        ISPICKVAL(Type,"Partner"),
        ISPICKVAL(Type, "Partner Customer"),
        ISPICKVAL(Type, "Direct Customer")
    )
)

On a side note, instead of using User Ids in there, you can assign a custom permission to such Users and then utilize that in your formula.

Related Topic