Skip to content

Commit

Permalink
Merge remote changes and resolve conflicts for DMLOptions implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
chininchu committed Oct 5, 2024
1 parent 50b05bc commit 60191e3
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions dlrs/main/classes/RollupService.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1663,19 +1663,16 @@ global with sharing class RollupService {
}

// Create DmlOptions instance
Database.DMLOptions dml = new Database.DMLOptions();
dml.DuplicateRuleHeader.allowSave = true;
dml.DuplicateRuleHeader.runAsCurrentUser = true;

Database.DmlOptions dmlOptions = new Database.DmlOptions();

// Allows save even if duplicated are detected
dmlOptions.duplicateRuleHeader.allowSave = true;

// Bypass duplicate rules


// Apply DmlOptions to each record
for (SObject record : masterRecords) {
record.setOptions(dml);
}
try {
return Database.update(masterRecords, allOrNothing);


} catch (DMLException e) {
// Determine if the exception is due to parent record/s having been deleted
Boolean throwException = true;
Expand Down

0 comments on commit 60191e3

Please sign in to comment.