Skip to main content
Shamser Dhami (javra) 님이 #Formulas에 질문했습니다

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개
  1. Steven Trumble (Strum Consulting) Forum Ambassador
    2023년 5월 24일 오후 12:08

    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