To display the total number of Products (Opportunity Line Items) associated with an Account record page, you need to create Roll-Up Summary fields. This article walks through creating two Roll-Up Summary fields: a COUNT field on the Opportunity object, and a SUM field on the Account object.
In Salesforce, the relationship hierarchy is: Account (Parent) → Opportunity (Child) → Opportunity Product (Grand Child). Opportunities are related to Accounts and Products (Opportunity Products, also called OpportunityLineItems) are related to Opportunities via Master-Detail relationships. Roll-Up Summary fields allow parent objects to aggregate data from child objects.
To display the total count of Products on an Account record, complete both steps below in order.
This field counts the number of Products (Opportunity Line Items) on each Opportunity.
In Lightning Experience: Gear Icon | Setup | Object Manager | Opportunity | Fields & Relationships | New
In Salesforce Classic: Setup | Customize | Opportunities | Fields | New
This field now shows the count of Products related to each Opportunity.
This field sums the Opportunity-level COUNT field created in Step 1, giving you the total Products across all Opportunities on an Account.
In Lightning Experience: Gear Icon | Setup | Object Manager | Account | Fields & Relationships | New
In Salesforce Classic: Setup | Customize | Accounts | Fields | New
This field now shows the total number of Products associated with all Opportunities on the Account.
000384075

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.