A roll-up summary field in Salesforce aggregates data from a child object to a parent object within a Master-Detail relationship. These fields use aggregation functions including COUNT, SUM, MIN, and MAX to calculate values across related child records.
For example, a roll-up summary field on the Account object can display the total opportunity amount for all related Opportunities. You can also apply filter criteria — for example, showing only the total value of won Opportunities associated with an Account.
Important: Roll-up summary fields are only available for objects in a Master-Detail relationship. They are not available for Lookup relationship fields.
For objects with a Lookup relationship — or for more complex aggregation logic — you can use a Salesforce Flow (Record-Triggered Flow) to achieve similar results. This article demonstrates how to build a Flow that counts the number of Cases related to each Account and writes that count to a number field on the Account object.
This example shows how to build a Salesforce Record-Triggered Flow that calculates the count of Cases related to an Account and stores that count in a custom number field on the Account object.
This causes the Flow to increment the CaseCount variable by 1 for each Case record in the collection.
{!$Record}).When the Flow runs, it retrieves all Cases related to the triggering Account, counts them, and updates the custom count field on the Account. This achieves a roll-up summary count effect for a Lookup relationship.
002722670

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.