+ Start a Discussion
kevin.chileskevin.chiles 

Validation rule not working correctly Please help!

Hello!

 

I am writing a validation rule that would (in theory) work like this.  If the Status field is Approved, or Pending Renewal, then the End date on the record can be pushed out to 1 YEAR past its current original end date (date field stamped on the record.

 

I can get this to work on the 1 picklist value (approved) and it works fine, but when I try to add logic to add the additional value, it wont let me save the record even though it does not meet the criteria needed for this to not fire.  

 

NOT(IsPICKLIST(Status__c,"Approved")&&End_Date__c+365>Original_End_Date__c ||

NOT(ISPICKLIST(Status_c,"Pending Renewal")&&End_Date__c+365>Original_End_Date__c)

 

So you would this this word work correctly, but it seems to want to fire the rule every time no matter what.  Is there something small that Im missing?

amarcuteamarcute

Hi,

 

Try this :

 

NOT(

    AND( End_Date__c+365>Original_End_Date__c,

         OR (

            ISPICKVAL(Status__c,"Approved")

            ISPICKVAL(Status_c,"Pending Renewal")

          )))