Skip to main content

I have condition i.e. User can select 'Completed' Stage__c if  prior value is either "Sent To Customer" or "Rejected". 

In order to Achieve this I have created below validation rule:

 

AND(

ISCHANGED(Stage__c),

ISPICKVAL(Stage__c, "Completed"),

OR(

!ISPICKVAL(PRIORVALUE(Stage__c), "Rejected"),

!ISPICKVAL(PRIORVALUE(Stage__c), "Sent To Customer")

)

)

 

if I just check one Stage prior value then it works but adding two conditions like 

AND(

ISCHANGED(Stage__c),

ISPICKVAL(Stage__c, "Completed"),

OR(

!ISPICKVAL(PRIORVALUE(Stage__c), "Sent To Customer")

)

)

 

Can anyone tell me what am I doing wrong? Is there any other way I can achieve this? Am I using OR wrong way?

 

@Formulas - Help, Tips and Tricks

16 answers
  1. Steven Trumble (Strum Consulting) Forum Ambassador
    May 24, 2023, 12:08 PM

    It's not working because you have two NOT in your OR, so this will always return true.

    If prior stage was rejected then Not "sent to customer" is true, if prior stage was not sent to customer then not rejected is true. If prior stage was anything else then they are both true

0/9000