Loading
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Recalculate Rollup By Lookup Summaries with Apex (Managed Package)

          Recalculate Rollup By Lookup Summaries with Apex (Managed Package)

          Use Apex code recalculate Rollup By Lookup summaries.

          Required Editions

          Available in: Lightning Experience
          Available in: Professional, Enterprise, and Unlimited Editions

          Managed Package Icon This is a Financial Services Cloud managed package feature.

          Note
          Note To recalculate rollup summaries for a small subset of data, either modify the underlying Financial Accounts or modify the Account Contact Relationship.

          To recalculate the RBL summaries using Apex code.

          1. Call a global class with the global constructor RollupRecalculationBatchable through Apex code.
            Note
            Note When running the RBL rules through Apex code, your list must not:
            • Be null or empty
            • Contain inactive, invalid, or duplicate RBL configuration IDs
          2. Create a list of IDs of your active Rollup By Lookup Configuration objects in the order that you want them to run.
          3. Create an instance of RollupRecalculationBatchable, and pass your list of IDs to it.
          4. Execute the batch job with Database.executeBatch. After you execute this batch job, future rollups are automatically executed.
          Example
          Example

          Here’s sample Apex code:

          // Create your list of IDs
          List<Id> rollupsToRun = new List<Id>();
          List<FinServ__RollupByLookupConfig__c> queriedRollups = [SELECT Id FROM FinServ__RollupByLookupConfig__c WHERE FinServ__Active__c = true];
          for (FinServ__RollupByLookupConfig__c rollup : queriedRollups) {
          rollupsToRun.add(rollup.Id);
          }
          
          // Create an instance of RollupRecalculationBatchable
          FinServ.RollupRecalculationBatchable job = new FinServ.RollupRecalculationBatchable(rollupsToRun);
          
          // Run the rollups
          Database.executeBatch(job);
          
           
          Loading
          Salesforce Help | Article