A sample code on how to use HouseholdAssignmentBatchable class from the anonymous window.
One you enabled Optimised Roll-ups with Winter 21 - Optimize Record Rollups
And as per this article: https://help.salesforce.com/articleView?id=release-notes.rn_fsc_rollup_config_custom_setting.htm&type=5&release=228
If you enabled the new Record Rollup Optimization (Beta) org preference, use the new HouseholdAssignmentBatchable batch job instead of GroupAssignmentBatchable to roll up records in batches.
Below is a sample code to how to run the HouseholdAssignmentBatchable batch job:
Option 1
To execute the job for a single object with configuration defined in the custom setting use the following signatureFinServ.HouseholdAssignmentBatchable.runJob('Task');
Option 2
To execute the job for multiple objects sequentially with configuration defined in the custom setting use the following signature
Option 3
To execute the job for one or more objects with overridden settings, New instances of class FinServ.HouseholdAssignmentBatchable.RecordRollupConfig need to be constructed and passed to FinServ.HouseholdAssignmentBatchable.runJob(List<FinServ.HouseholdAssignmentBatchable.RecordRollupConfig> recordRollupConfigs).
FinServ.HouseholdAssignmentBatchable.RecordRollupConfig provides two constructors:
//startTime, endTime can be set to null.//When set to null that filter is not applied when querying the object.
//Constructor 1:
RecordRollupConfig(String objectName, Datetime startTime, Datetime endTime)
//Constructor 2:
RecordRollupConfig(String objectName, Datetime startTime, Datetime endTime, Integer scope)
No comments:
Post a Comment