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

Validation rule not working correctly Please help!



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?




Try this :



    AND( End_Date__c+365>Original_End_Date__c,

         OR (


            ISPICKVAL(Status_c,"Pending Renewal")