[SalesForce] Error: Function PRIORVALUE may not be used in this type of formula

I have trying to build a formulae in workflow on the Final result which should show error message if the the prior value of Final Result is either (ACCEPTED,Need More Information-Incorrect Patient/Insurance Information,Need More Information-Waiting For Fax/Documents/Dx Codes) to REJECTED it show send an email. Final Result is a picklist field.

OR(

AND(
ISPICKVAL(PRIORVALUE(Final_Result__c),"ACCEPTED"),ISPICKVAL(Final_Result__c,"REJECTED")),


AND
(ISPICKVAL(PRIORVALUE(Final_Result__c),"Need More Information-Incorrect Patient/Insurance Information"),ISPICKVAL(Final_Result__c,"REJECTED")),

AND
(ISPICKVAL(PRIORVALUE(Final_Result__c),"Need More Information-Waiting For Fax/Documents/Dx Codes"),ISPICKVAL(Final_Result__c,"REJECTED")))

I get the error:

Function PRIORVALUE may not be used in this type of formula

Am I doing something wrong?

Best Answer

Make sure you set Evaluation Criteria to created, and any time it's edited.

You will get this error if you instead select created or created, and any time it's edited to subsequently meet criteria. The same holds true for ISCHANGED.

See also: Formula Operators and Functions

This function is available only in:

  • Assignment rules
  • Validation rules
  • Field updates
  • Workflow rules if the evaluation criteria is set to Evaluate the rule when a record is: created, and every time it’s edited.
  • Formula criteria for executing actions in the Process Builder.