Hi, I'm trying to get some help with a validation rule formula. I have the following validation rule that is working as expected.
AND(
ISPICKVAL(StageName, "6 Closed Business Won"),
ISPICKVAL(Type, "Upgrade"),
NOT(Customer_Approved_Upgrade__c)
)
However, I'm trying to add another line for different type value, but once I add second Type line it no longer works. So this one below does not work. I'm assuming I need to add an And Or formula. I would appreciate any suggestions on how to get this formula working. Thanks.
AND(
ISPICKVAL(StageName, "6 Closed Business Won"),
ISPICKVAL(Type, "Upgrade"),
ISPICKVAL(Type, "Amendement"),
NOT(Customer_Approved_Upgrade__c)
)
Hi Philip,
You are correct. You will need to use an OR operator in the validation rule.
Type on the Opportunity is a picklist field, so there can only be one value in the field, but your "AND" formula is looking for the type field to hold two values.
I recommend using this formula:
AND(
ISPICKVAL(StageName, "6 Closed Business Won"),
NOT(Customer_Approved_Upgrade__c),
OR(ISPICKVAL(Type, "Upgrade"),
ISPICKVAL(Type, "Amendement"))
)
It's a good practice to put the OR statement at the end of your AND statement if using both.
Hope this helps!
Lisa