From 7b0861cc78f555e4adcb956f255ea32ed7d1508d Mon Sep 17 00:00:00 2001 From: Andrew Fawcett Date: Sat, 18 Feb 2017 16:28:58 -0800 Subject: [PATCH] Fix for regression around deleting job execution records https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/4 - Occurred when using Custom Metadata mode. --- rolluptool/src/classes/RollupService.cls | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rolluptool/src/classes/RollupService.cls b/rolluptool/src/classes/RollupService.cls index 61801bb6..18a782b5 100644 --- a/rolluptool/src/classes/RollupService.cls +++ b/rolluptool/src/classes/RollupService.cls @@ -328,7 +328,12 @@ global with sharing class RollupService **/ public static void clearCalculateJobId(Set lookupIds) { - delete [select Id from LookupRollupCalculateJob__c where LookupRollupSummaryId__c in :lookupIds]; + // LookupRollupSummaryId__c are 18 char Ids ensure the ones we filter on are as well + Set char18Ids = new Set(); + for(String lookupId : lookupIds) { + char18Ids.add((String) ((Id)lookupId)); + } + delete [select Id from LookupRollupCalculateJob__c where LookupRollupSummaryId__c in :char18Ids]; } /**