declarative-lookup-rollup-summaries
declarative-lookup-rollup-summaries copied to clipboard
RollupService.triggerHandler() only appears to run in after context, so why do DLRS triggers have all contexts?
It appears that all DLRS triggers only contain one line that calls dlrs.RollupService.triggerHandler(Opportunity.SObjectType), and all those triggers fire in every before/after context.
However, triggerHandler is below, and if Trigger.isBefore, it clearly returns nothing.
Shouldn't the triggers only fire in the after context so as to save all the recurring triggers from firing in before context? Can we simply remove all before contexts from the triggers? DLRS seems to eat up a lot of processing limits and this seems partly the reason.
global static void triggerHandler(SObjectType childObjectType){ triggerHandleInvoked = true; // Currently no processing in the before phase if(Trigger.isBefore) return; // Anything to rollup? handleRollups(Trigger.oldMap, Trigger.newMap, childObjectType, new List<RollupSummaries.CalculationMode> { RollupSummaries.CalculationMode.Realtime, RollupSummaries.CalculationMode.Scheduled }); }