Rollup fields were introduced with Microsoft Dynamics CRM 2015. A Rollup field contains aggregated value calculated from child records for a parent record. For example: Active Products for a Company or Open Opportunities for an Account.
To understand how Rollup calculation works and how frequent this calculation happens, we need to understand what happens when you create a Rollup field for an entity.
Asynchronous System Jobs:
Dynamics 365 creates two asynchronous recurring system jobs as below when new Rollup field in created for an entity:
You can monitor these two jobs under Systems jobs entity using “Recurring System Jobs” view as:
Modify Recurrence Frequency:
As mentioned above, Mass Calculate Rollup Field job is executed in 12 hours after Rollup field is created or updated. But in case you do not want to wait for 12 hours and have first instance of job to be started immediately, follow below steps:
Once Mass Calculate Rollup Field job is executed successfully, Calculate Rollup Field job will kick in and run every hour for any incremental changes on existing records. This setting is configurable in case you want this job to run less frequently, follow below steps:
In case you want to calculate Rollup field immediately whenever child record gets created, updated or deleted, you can write custom C# plugin or custom workflow activity and use SDK message “CalculateRollupFieldRequest”. For more information refer blog.