From 66910f779cb5ad8b5e626991ff5efc811ad760a4 Mon Sep 17 00:00:00 2001 From: Andrew Chu Date: Tue, 8 Oct 2024 12:31:31 -0500 Subject: [PATCH] Fixed ticket 1007 --- dlrs/main/classes/RollupService.cls | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dlrs/main/classes/RollupService.cls b/dlrs/main/classes/RollupService.cls index 3890de9a..e2fe5b74 100644 --- a/dlrs/main/classes/RollupService.cls +++ b/dlrs/main/classes/RollupService.cls @@ -1670,13 +1670,10 @@ global with sharing class RollupService { // Run as current user to enforce sharing rules dml.DuplicateRuleHeader.runAsCurrentUser = true; - // Apply DmlOptions to each record - for (SObject record : masterRecords) { - record.setOptions(dml); - } + dml.OptAllOrNone = allOrNothing; try { - return Database.update(masterRecords, allOrNothing); + return Database.update(masterRecords, dml); } catch (DMLException e) { // Determine if the exception is due to parent record/s having been deleted Boolean throwException = true; @@ -1699,6 +1696,7 @@ global with sharing class RollupService { return new List(); } // Throw on as normal + throw e; } }