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
Roma89Roma89 

Need help with Syntax around PRIORVALUE workflow rule

 Trying to create a workflow rule that changes the Case Status to "Returned" if the Case Tier field is changed from Development to Tier. Below is the formula I created, but it's not working. I think I over thought this rule and made it more complex than it needs to be. Not sure how to simplfy it.

 

IF(AND(CaseTier__c =Tier 3,ISPICKVAL(PRIORVALUE(CaseTier__c), “Development”),"Returned", null)

 

Thanks,

p

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Roma89Roma89

Werner,

Thanks for helping me get on the right track. Had to tweek your code a little bit. Here is the code that worked for me. I also had to select the third Evaluation rule "Every time a record is created or edited" to make this work. Not exactly sure why. I just know that I had to select that value.

AND(
ISPICKVAL(PRIORVALUE(CaseTier__c), "Development"),
ISPICKVAL(CaseTier__c,"Tier 3")
)

 


 

All Answers

wgrawgra
This one could work:

 

 

 

AND(
ISPICKVAL(PRIORVALUE(CaseTier__c), "Development"),
ISPICKVAL(CaseTier__c,"Tier")
)

 

Werner

 

 

Roma89Roma89

Werner,

thanks for the assistance. I tried your formula but I get the following error message, "Function PRIORVALUE may not be used in this type of formula".  I should also be a little more clear in what I'm trying to get this workflow rule to do. 

 

1. I've already created a rule to update the field "Status" to Returned.

2. What I'm having issues with is creating the workflow rule formula that will trigger the field update rule. The workflow rule formula needs to identify when the field "Case Tier" is changed from Development to Tier 3.

 

I can then assoicate the field update rule to the formula workflow rule.

 

Hope that clairifies what I'm trying to do. Any additional help you could give would greatly be appreciated.

thx,

p

 

Roma89Roma89

Werner,

Thanks for helping me get on the right track. Had to tweek your code a little bit. Here is the code that worked for me. I also had to select the third Evaluation rule "Every time a record is created or edited" to make this work. Not exactly sure why. I just know that I had to select that value.

AND(
ISPICKVAL(PRIORVALUE(CaseTier__c), "Development"),
ISPICKVAL(CaseTier__c,"Tier 3")
)

 


 

This was selected as the best answer
wgrawgra

Great it worked, "Every time a record is created or edited" is the right option for this type of workflow rule as it has to be evaluated after every change of the record, I forgot to mention this.

 

Best regards,

 

Werner