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 help

I have the following validation rule, but it doesn't work as I'm expecting


AND(NOT(ISPICKVAL(Delivery_Type__c ,"Customer non-revenue")),(Days_Available__c < 0))


I want the validation rule to fire when the following is true:


If the picklist value "Customer non-revenue for the delivery type field is not selected and the days available field is less than zero.


So, if the delivery type is customer non-revenue, the validation evaluates to false and the validation doesn't fire.


right now, the validation is always evaluating to true and fires if the days available is negative.  I just can't get the delivery type portion of the validation working correctly.


Thanks for any help.


Tabifying it gives you:



AND( NOT( ISPICKVAL(Delivery_Type__c ,"Customer non-revenue") ), (Days_Available__c < 0) )

 It appears to be exactly what you're trying to express.  Perhaps you have a typo in the string "Customer non-revenue"?  It should match exactly, case and all.






I have verified there isn't a typo in the 'Customer non-revenue' is correct.


So, if I choose a delivery type of 'Customer non-revenue and the available days is negative, the validation should evaluate to false and not fire, correct?


When I test it using the above criteria it evaluates to true and the validation fires the error message.  Something is incorrect in the validation.

Try breaking it down.  Get rid of the AND and see what happens if you have nothing but the ISPICKVAL.