0

I have Three task based on Validation rule

1.Due date should not be less than invoice date.

(Due_Date__c  >  Invoice_Date__c)

2.Invoice date should not be in the past.

(Invoice_Date__c  >=  TODAY())

3.Quote Approval Status should be Approved.

(ISPICKVAL( Status , "New") && ISPICKVAL( Status , "Prepared") && ISPICKVAL( Status , "In Process")  && ISPICKVAL( Status , "Paid") &&  ISPICKVAL( Status , "Partially Paid")  && ISPICKVAL( Status , "Open") &&  ISPICKVAL( Status , "On-Hold")  && ISPICKVAL( Status , "Cancelled") &&   ISPICKVAL( Status , "Consolidated")

But it's not working. Could any one help me out.

1
  • 1
    #3 will always evaluate to false as a Status cannot be all of of those. Either change to OR or change to NOT(ISPICKVAL(Status 'Approved'))
    – Eric
    Commented Apr 6, 2017 at 12:33

1 Answer 1

1

A validation rule is there to prevent wrongly input data.

In that sense, the criteria for the validation rule to trigger is defined in the "Error Condition Formula" box. If the criteria is met, the DML statement isn't applied.

It seems it got a little mixed up in the code. It'll become as this if we follow the task :

  1. Due date should not be less than invoice date.

    (Due_Date__c  <  Invoice_Date__c)
    
  2. Invoice date should not be in the past.

    (Invoice_Date__c  <  TODAY())
    
  3. Quote Approval Status should be Approved. As suggested by Eric, change this one into

    NOT(ISPICKVAL(Status 'Approved')
    

There are actually quite a lof of examples here if you want to expand your knowledge.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .