0

I have this validation formula, which is not firing when I provide a Contract_End_Date__c prior to today's date. Otherwise for any future date it is working as expected.

AND(
    ISPICKVAL(Status_Category__c ,"In Effect"),
    ISCHANGED(Contract_End_Date__c),
    NOT(ISPICKVAL(Status__c ,"Extended")),
    NOT(ISPICKVAL(Status__c ,"Preponed"))
)
6
  • 2
    Are there any triggers or flows running for that object that might be doing something to the date or the status and category?
    – fred
    Commented Feb 22 at 15:21
  • Above validation rule criteria only check the Contract_End_Date__c is changed or not only not like the given date value is past date value or future. So May be can you please add another one condition as Contract_End_Date__c > TODAY() into that same AND block and Check again?
    – Raj
    Commented Feb 22 at 17:50
  • 1
    @Raj Adding another condition into an AND() will never make it return true if it is currently returning false (as is the case here).
    – Derek F
    Commented Feb 22 at 18:41
  • Validation rule cannot be bypassed by any trigger or flow
    – Jolly
    Commented Feb 23 at 4:33
  • That wasn't the point that fred was getting at. Triggers and flows can run before your validation rule is checked. If you have a before update trigger that says "if this date is in the past, undo that change", then ISCHANGED(Contract_End_Date__c) would see that there is no change. I suppose this isn't really a question about if you have a flow/trigger that's modifying your date so much as it is a statement that you must currently have such a flow/trigger for you to observe the results you're seeing. You'll need to either accept that behavior, or find that flow/trigger and change it.
    – Derek F
    Commented Feb 23 at 17:16

0

You must log in to answer this question.

Browse other questions tagged .