Skip to main content
I have the following validation rule on my opportunity, however I want to add one more line and I am not getting past the syntax error.

 

The formula currently prevents the user from selecting "Closed Won" as the stage IF they have not included a Sales Order Number, a PO Number AND flagged lines as purchased on the quote. 

 

I would like to amend the formula so that a user can enter "RMA" in the Sales Order Number (text) field which will allow the stage to be Closed Won without having purchased lines on the quote.

 

Thank you in advance for any assistance you can provide.

 

AND(

 

ISPICKVAL( StageName , "Closed Won"),

 

OR(

 

ISBLANK ( Sales_Order_Number__c ),

 

ISBLANK ( PO_Number__c ),

 

HasPurchasedQLs__c =false

 

)

 

)
3 件の回答
  1. 2019年10月9日 1:58

    Hi Kim, 

     

    Try the formula below:

     

     

    AND(

        ISPICKVAL( StageName , "Closed Won"),

        ISCHANGED( StageName),

        OR(

            ISBLANK ( Sales_Order_Number__c ),

            ISBLANK ( PO_Number__c ),

            AND(

                HasPurchasedQLs__c =false,

                Sales_Order_Number__c<>'RMA'

            )

        )

    )

    This will prevent the the stage from moving to closed won if 

    HasPurchasedQLs__c is equal to false and Sales Order Number is equal to RMA.

     

    I also modified your formula so that it will only be triggered if the Stage has been changed.

     

    Hope it helps!
0/9000