Ask Search:
Veronica BlankVeronica Blank 

Multiple ANDs in Validation Rule

Hi everyone!
A little bit stuck of this formula, it's just not firing :(((  Anyone has an idea why?  All I am trying to do is to say if the certain stage  is selected ("Analysis"), other fields need to have the values specified below in order to save.

AND( 
NOT(ISPICKVAL( Budget , "Approved")), 
NOT(ISPICKVAL( Process_Status, "Decision Makers")), 
NOT(ISPICKVAL( Status__c , "Maybe ")), 
NOT(ISPICKVAL( Pricing_Status__c , "Negotiation")), 
ISPICKVAL( StageName , "Analysis") 
)

Many thanks.
Best Answer chosen by Veronica Blank
Narender SinghNarender Singh
Try this:
AND(
    OR(
        NOT(ISPICKVAL(Budget, "Approved")) && NOT(ISPICKVAL(Budget, "Completed")),
        NOT(ISPICKVAL(Process_Status, "Decision Makers")),
        NOT(ISPICKVAL(Status__c, "Maybe")) && NOT(ISPICKVAL(Status__c, "Yes")),
        (NOT(ISPICKVAL(Pricing_Status__c, "Negotiation")) && NOT(ISPICKVAL(Pricing_Status__c, "Approved")))
    ),
    ISPICKVAL(StageName, "Analysis")
)

 

All Answers

Deepak AnandDeepak Anand
Try this = 
AND(
    OR(
        NOT(ISPICKVAL(Budget, "Approved")),
        NOT(ISPICKVAL(Process_Status, "Decision Makers")),
        NOT(ISPICKVAL(Status__c, "Maybe")),
        NOT(ISPICKVAL(Pricing_Status__c, "Negotiation"))
    ),
    ISPICKVAL(StageName, "Analysis")
)
Veronica BlankVeronica Blank
Thank you Deepak!
Is any way to add additional statements based of the conditions below? Your formula works, and it will be life-saving to add other selection....

Oppty in Stage " Analysis"  AND
Budget "Approved" OR " Completed"
Status " Maybe" OR " Yes"
Pricing Status " Negotiation" OR " Approved"



 
Narender SinghNarender Singh
Try this:
AND(
    OR(
        NOT(ISPICKVAL(Budget, "Approved")) && NOT(ISPICKVAL(Budget, "Completed")),
        NOT(ISPICKVAL(Process_Status, "Decision Makers")),
        NOT(ISPICKVAL(Status__c, "Maybe")) && NOT(ISPICKVAL(Status__c, "Yes")),
        (NOT(ISPICKVAL(Pricing_Status__c, "Negotiation")) && NOT(ISPICKVAL(Pricing_Status__c, "Approved")))
    ),
    ISPICKVAL(StageName, "Analysis")
)

 
This was selected as the best answer
Deepak AnandDeepak Anand
Try this = 
AND(
    OR(
        AND(
            NOT(ISPICKVAL(Budget, "Approved")),
            NOT(ISPICKVAL(Budget, "Completed"))
        ),

        NOT(ISPICKVAL(Process_Status, "Decision Makers")),

        AND(
            NOT(ISPICKVAL(Status__c, "Maybe")),
            NOT(ISPICKVAL(Status__c, "Yes"))
        ),

        AND(
            NOT(ISPICKVAL(Pricing_Status__c, "Negotiation")),
            NOT(ISPICKVAL(Pricing_Status__c, "Approved"))
        )
    ),
    ISPICKVAL(StageName, "Analysis")
)