System Admins can use Rollup Summary Fields to calculate data from a related Child Object to a field created on the Parent Object, all without using code. Rollup Summaries also allow you to filter the data being pulled in. For example, you can create a Rollup Summary Field that will count all event registrations for a specific event with the registration status of Canceled.

For more technical information on Rollup Summaries, please read Creating Rollup Summaries in Fonteva's Developer Documentation.

Create a Rollup Summary Field

The third step is to create the Rollup Summary Field. You will take the fields and criteria identified in Steps 1 & 2 to populate the necessary fields in the New Rollup Summary window.

The following operations are available to calculate Rollup Summary Fields:

  • Sum - Returns the total amount resulting from the addition of two or more numbers, amounts, or items.

  • Max - Returns the highest value in a range of data values.

  • Min - Returns the minimum value in a range of data values.

  • Average - Adds or sums up all values and then calculates the average.

  • Count - Returns a count of the number of data values.

  • Concatenate - Pulls in multiple values and separates them by commas. For example: If you have contacts with multiple membership types, you can roll up all the names of the membership types into a single field with the membership names separated by commas.

  • Concatenate Distinct - Pulls in multiple values and separates them by commas. Any duplicate values are filtered out.

How to Create a Rollup Summary:

  1. Navigate to the Fonteva Framework tab and click Rollup Summary Fields from the Dashboard. The Rollup Summary Fields page will open.

  2. Click the + New Rollup Summary Field button. This will open the New Rollup Summary window.

  3. From the New Rollup Summary window, configure the below fields. If AND or OR are included in the Rollup Summary filter, the filter needs to be in parentheses.

    1. Parent SObject: Select the object from the picklist that displays the calculated Rollup Summary.

    2. Parent Field: Select the field from the picklist where the Rollup Summary data will display.

    3. Child SObject: Select the object or item from the picklist to be included in calculations for the rollup summary.

    4. Relationship Field: Select the field from the picklist that defines the lookup relationship that determines the relationship for the calculation. This defines how the two records are related.

    5. Child Field: Select the field located on the Child Object that will calculate the value in the Rollup Field we created on the Parent Object.

    6. Operation: Select the mathematical operator that will be used to calculate the Rollup Summary. Options include: Sum, Maximum, Minimum, AverageCountConcatenateConcatenate_Distinct.

    7. Filter: Type a SOQL filter to narrow the results. Filters are formatted like SOQL statements without the where clause, as it is assumed by our system. Filters cannot take relationships (variables ending in _ _r).  Remember that full API names must be used for any filter. For dates, you can use things in the filter like TODAY or THIS_MONTH to indicate relative dates. See Salesforce Help Documentation on Relative Date Values for Filter Criteria and Filter Operators Reference.

  4. Check Is Enabled. This must be checked in order to activate the new Rollup Summary field.

  5. If desired, check Enable Batching in order to run the Rollup Summary field whenever the scheduled job (Rollup_Scheduler) is scheduled. See the below section on How to Schedule a Rollup Scheduler for Batch Rollups. Some orgs have several triggers and other processes built out on objects, and the information being aggregated by the Rollup may not be needed in real-time, but rather day over day. Batching allows orgs to get daily updates on those fields when OrderApi.Scheduler runs overnight, lessening the burden on their jobs queue and keeping cases of non-update or misfire to a minimum.

    1. Check Parent Batch Scope. If batching is enabled, enter "2000" into the Parent Batch Scope field.

    2. Check Child Batch Scope. If batching is enabled, enter "2000" into the Child Batch Scope field.

  6. If desired, uncheck Enable Trigger. This will disable the update trigger for the parent record for this Rollup Summary Field and prevent an excess of updates from the parent record for this Rollup Summary Field. You might want to disable the Trigger in order to improve the execution time of your Rollups. By default, it is enabled. You can return at any time after configuring this Rollup Summary Field to enable or disable the Trigger

  7. Click Submit.

  8. The new rollup summary has been created. 

Rollup Summaries and Batch Rollups:

Rollup Summary Fields do not need to be manually run. They will process automatically when a corresponding record to the Rollup Summary Field is updated. This means batching Rollup Summaries is no longer essential to processing large amounts of records for Child Objects. Users will need to uncheck the Enable Batching feature from all of their Rollup Summary Fields in the Spark Framework App. To do this:

  1. From the Rollup Summary Fields page, locate the desired Rollup Summary Field row.

  2. For the desired Rollup Summary Field, in the Action column, click the down arrow to display the Actions Menu.

  3. Select Edit to open the Edit Rollup Summary window.

  4. From the Edit Rollup Summary window, uncheck Enable Batching.

  5. Click Save to apply your changes.

Repeat steps 2-5 for all Rollup Summary Fields.

Manually Running Rollup Summaries:

Rollup Summaries will run automatically and are not required to be run manually. If necessary, though, they can be run manually.

  1. From the Rollup Summary Fields page, locate the desired Rollup Summary Field row.

  2. In the Action column, click the down arrow to display the Actions Menu.

  3. Select Run.

  4. The Rollup Summary Field will run.

How to Schedule a Rollup Scheduler for Batch Rollups:

You can schedule a specific time for all Batch Rollups that were created in the system to be run in the system.

  1. From the top-right of the Salesforce window, click Setup.

  2. From from the Quick Find Search field in the left-side menu, type Apex Classes and select Apex Classes from the results. The Apex Classes page will open.

  3. Click the Schedule Apex button. This opens the Schedule Apex page.

  4. From the Schedule Apex page, in the Job Name field, type a name for the job.

  5. Next to the Apex Class field, click the Lookup Button.

  6. In the Lookup window, select RollupScheduler.

  7. In the Schedule Apex Execution section, select the Frequency, Start, End, and Preferred Start Time configurations.

  8. Click Save to schedule the Apex Class.

Next Steps: