+ Start a Discussion
Eric PohlabelEric Pohlabel 

Validation rule to prevent certain profile users from changing a picklist value unless the picklist value is value "A" or "B"

I have a picklist on a custom object called Status__c.  This field has many value options including "Assigned" and "Sent for Revision". If the user is a particular profile, I ONLY want them to be able to change the picklist value if the current value is "Assigned" or "Sent for Revision".  So far this is what I have:
AND(ISCHANGED(Status__c),
OR(
NOT(
 ISPICKVAL( PRIORVALUE (Status__c), "Assigned"),
 ISPICKVAL( PRIORVALUE (Status__c), "Sent for Revisions"),
 ($Profile.Name = "Freelance Writer")
)

Of course this isnt correct, but Im having trouble determining where my logic and/or syntax is off.
 
Best Answer chosen by Eric Pohlabel
LBKLBK
You are very close. Here is your formula.
AND
(
ISCHANGED(Status__c),
NOT(ISPICKVAL(Status__c,"Assigned")),
NOT(ISPICKVAL(Status__c,"Sent for Revisions")),
$Profile.Name = "Freelance Writer"
)
Let me know if this helps.
 

All Answers

LBKLBK
You are very close. Here is your formula.
AND
(
ISCHANGED(Status__c),
NOT(ISPICKVAL(Status__c,"Assigned")),
NOT(ISPICKVAL(Status__c,"Sent for Revisions")),
$Profile.Name = "Freelance Writer"
)
Let me know if this helps.
 
This was selected as the best answer
Eric PohlabelEric Pohlabel
Trying it now - THANK YOU!!
Jay kerson ReponteJay kerson Reponte
how does it work in deploying metadata?