Skip to main content The new Salesforce certifications experience is live! Visit Trailhead Academy to explore your new certifications homepage.
I'm trying to create a validation rule that requires products on all new opportunities, opportunities with a previous pricebook selected but no products and existing opportunities without a previously selected pricebook or products.

 

With the current validation, I get an error message when selecting the price book so I can't save the price book and move on to adding the products.  I also need the ability for users to change price books (we have several and sometimes they select the wrong one) which requires them to remove the products before they can change the pricebook.

 

This causes major issues because my opportunity data is accessed by an external database but only if products are added.  I so need to get this fixed asap.

 

Thanks so much for your help!

 

Here is my validation rule:

 

AND(CASE(StageName, "Stage 1", 1, 

"Stage 2", 1, 

"Stage 3", 1, 

"Stage 4", 1, 

"Stage 5", 1, 

"Stage 6", 1, 

"Stage 7", 1,0) = 1, 

NOT(HasOpportunityLineItem),  OR($

Profile.Name = "Account Executive", $Profile.Name

= "Inside Sales Rep"),

NOT(ISNEW()), NOT(ISCHANGED( Pricebook2Id)))

2 answers
Loading
  1. Aug 29, 2012, 8:22 PM
    We use the prompt to add products feature. The problem with that is users can click cancel without adding products when prompted...validation rule will trigger in that instance.  :(
0/9000