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
Terry_0101Terry_0101 

Prevent certain picklist values from changing

This is not working below as a user can still change a picklist value from Business (Legal) to another value.  

1.  How to prevent changing from the these values belowin italics?
2.  Also, how to prevent users from choosing these values?

AND ( 
CASE( Type, 
"Business (Legal)", 1, 
"Retail (Apparel)",1,
0) = 1, 
PRIORVALUE( Type ) <> "Business (Legal)",
PRIORVALUE( Type ) <> "Retail (Apparel)", 
ISCHANGED(Type), 
NOT( 
OR( 
$Profile.Id = "00000000", /*sys admin*/ 
James LoghryJames Loghry
This validation rule only prevents ​changing a value from other than Business / Retail TO Business / Retail.  To cover both criteria you need an "exclusive or" condition.  Rather a condtition where you compare the Current and Prior values of type to see that either values are Business / Retail, but not both of them.  You can accomplish this by using ANDs and ORs together.  Here's what I came up with.  I havent tested it, so you might find some or many :) errors and typos.

Another issue could be that your profile id is incorrect (for instance it differs between production and sandbox).

Good luck! 
AND(
    ISCHANGED(Type)
    ,OR(
        AND(
            OR(
                Type = "Business (Legal)",
                Type = "Retail (Apparel)"
            ),
            OR(
                PRIORVALUE( Type ) <> "Business (Legal)", 
                PRIORVALUE( Type ) <> "Retail (Apparel)"
            )
        ),
        AND(
            OR(
                Type <> "Business (Legal)",
                Type <> "Retail (Apparel)"
            ),
            OR(
                PRIORVALUE( Type ) =  "Business (Legal)", 
                PRIORVALUE( Type ) =  "Retail (Apparel)"
            )
        )
    ),
    $Profile.Name <> "System Administrator"
)