You need to sign in to do that
Don't have an account?

Use PRIORVALUE Function On Picklist Validation Rule
Hello,
I have a Picklist in which one of the fields is "Error". On a user changing form fields and choosing to choose a different picklist value I want a validation rule to check the previous value of the picklist field and to only allow certain values to be picked if previously at "Error". I have tried the following.
OR(AND(PRIORVALUE(Request_Status__c)='Error' , Request_Status__c<>'Draft Request'),AND(PRIORVALUE(Request_Status__c)='Error' , Request_Status__c<>'Endorse'))
I receive an error as follows:
Error: Field Request_Status__c is a picklist field. Picklist fields are only supported in certain functions. Tell me more
The "Tell me More" link brings me to teh following article https://avaya--c4rdev.cs12.my.salesforce.com/help/doc/user_ed.jsp?loc=help&target=tips_on_building_formulas.htm%23picklists_and_msps§ion=Customizing
In which it states "
- PRIORVALUE(Only in assignment rules, validation rules, workflow field updates, and workflow rules in which the trigger type is set to Every time a record is created or edited)"
I do want this to run though every time an edit occurs though so figured it should work.
Does anyone happen to know from looking at the above what I may be doing wrong and a way to get around this?
Thanks in advance.
Hi there,
Since you are using a picklist, you should use ISPICKVAL in your validation rule. Also, you will need to rewrite your rule a little bit. It looks like your rule is trying to say "If the previous value of Request_Status__c was Error, then the new value cannot be Draft or Endorse."
If that is the case, your rule should look something like this:
OR(
AND(
ISPICKVAL(PRIORVALUE(Request_Status__c),"Error"), NOT(ISPICKVAL(Request_Status__c,"Draft Request"))
),
AND(
ISPICKVAL(PRIORVALUE(Request_Status__c),"Error"), NOT(ISPICKVAL(Request_Status__c,"Endorse")))
)
I hope this helps.
Kemi
All Answers
Hi there,
Since you are using a picklist, you should use ISPICKVAL in your validation rule. Also, you will need to rewrite your rule a little bit. It looks like your rule is trying to say "If the previous value of Request_Status__c was Error, then the new value cannot be Draft or Endorse."
If that is the case, your rule should look something like this:
OR(
AND(
ISPICKVAL(PRIORVALUE(Request_Status__c),"Error"), NOT(ISPICKVAL(Request_Status__c,"Draft Request"))
),
AND(
ISPICKVAL(PRIORVALUE(Request_Status__c),"Error"), NOT(ISPICKVAL(Request_Status__c,"Endorse")))
)
I hope this helps.
Kemi
Thanks Kami for your help. Much appreciated!
Bonefish Grill Happy Hour is a great way to get some delicious seafood without breaking the bank. Enjoy delicious seafood and low-priced drinks at this seafood restaurant’s happy hour every day.