Loading

Show the Sum of Products associated to Opportunities on the Account object

Дата публикации: Jun 11, 2026
Описание

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.

Step 1: Create a COUNT Roll-Up Summary Field on Opportunity

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

  1. Data Type: Roll-Up Summary. Click Next.
  2. Enter the Field Label and Field Name. Click Next.
  3. Summarized Object: Opportunity Product.
  4. Roll-Up Type: COUNT.
  5. Filter Criteria: Select "All records should be included in the calculation" (or specify criteria if needed). Click Next.
  6. Set field visibility for the necessary profiles. Click Next.
  7. Add the new field to the appropriate Page Layouts.
  8. Save.

This field now shows the count of Products related to each Opportunity.

Step 2: Create a SUM Roll-Up Summary Field on Account

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

  1. Data Type: Roll-Up Summary. Click Next.
  2. Enter the Field Label and Field Name. Click Next.
  3. Summarized Object: Opportunity.
  4. Roll-Up Type: SUM.
  5. Field to Aggregate: Select the Roll-Up Summary field created in Step 1 (the COUNT field on Opportunity).
  6. Filter Criteria: Select "All records should be included in the calculation" (or specify criteria if needed). Click Next.
  7. Set field visibility for the necessary profiles. Click Next.
  8. Add the new field to the appropriate Page Layouts.
  9. Save.

This field now shows the total number of Products associated with all Opportunities on the Account.

Дополнительные ресурсы

Implement Roll Up Summary Fields

Номер статьи базы знаний

000384075

 
Загрузка
Salesforce Help | Article