Skip to main content Stream TDX Bengaluru on Salesforce+. Start learning the critical skills you need to build and deploy trusted autonomous agents with Agentforce. Register for free.

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) 

)

4 answers
  1. Oct 17, 2024, 1:17 AM

    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

Loading
0/9000