Organizations that have purchased the Salesforce Products (Price Books and Products) module can configure Opportunities to prompt users to add Products when saving. This article explains how to enable the Prompt Users to Add Products setting in Opportunity Settings and describes known scenarios where Opportunities may still be saved without Products despite this setting being enabled. It also provides sample Validation Rule formulas to more strictly enforce Product entry.
This article explains how to make Products required on Opportunities in Salesforce for organizations that have purchased the Products module, why Opportunities can still be saved without Products, and how to enforce Product entry with a field setting or Validation Rules.
To make Products required on Opportunities, log in as a system administrator and follow the instructions below:
In certain situations, this setting can be overridden by user behavior, which may result in Opportunities without related Products. This is expected and can happen in any of the following situations:
Salesforce cannot control the fourth situation above because the User is working around the logic structure of the application.
This setting can also be overridden when the Opportunity "New" button is overridden with a component that implements force:createRecord.
Salesforce recommends the following workaround to "enforce" Product entry on each Opportunity: make the Amount field read-only on Opportunities. Products then have to be entered on an Opportunity in order for the Amount field to be populated with a value. Review Field Access.
To make Products required via Validation Rules, use the field name "Has Line Item" in the formula. Create the Validation Rule here:
The following formula prevents saving an Opportunity without Products if the Stage is set to Needs Analysis, Qualified, or Proposal Submitted. Update the stage names to match your org's configured Opportunity stages.
AND( OR( ISPICKVAL(StageName,"Needs Analysis"), ISPICKVAL(StageName,"Qualified"), ISPICKVAL(StageName,"Proposal Submitted")), HasOpportunityLineItem = FALSE )
This formula returns TRUE, which triggers the validation error, when the Stage is one of the three listed stages and the Opportunity has no Products (HasOpportunityLineItem is FALSE).
The following formula prevents saving an Opportunity without Products only when the Stage is set to Needs Analysis.
AND( ISPICKVAL(StageName,"Needs Analysis"), HasOpportunityLineItem = FALSE )
This formula returns TRUE, which triggers the validation error, when the Stage is Needs Analysis and the Opportunity has no Products.
Note: This validation rule only works if an Opportunity has a Price Book added.
000384448

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.