Skip to content

Commit

Permalink
Merge pull request #7264 from SalesforceFoundation/feature/254__W-157…
Browse files Browse the repository at this point in the history
…38518-fix-Math-Exception-on-Duplicate-Contact-Merge

W-15738518 - fix Math Exception on Duplicate Contact Merge
  • Loading branch information
screcco-sfdo authored Nov 14, 2024
2 parents 0d6bc4b + ede5cdd commit 129439f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion force-app/main/default/classes/CRLP_RollupQueueable.cls
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ public class CRLP_RollupQueueable implements System.Queueable {
if (objType == Account.SObjectType || objType == Contact.SObjectType) {
// If the summary record has more child opportunities and possibly payments than can be handled in
// this queueable (non-async job), remove it from this processing queue
Integer maxOppsToAllow = (MAX_ATTACHED_OPPS_FOR_QUEUABLE / summaryRecords.size());
Integer divisor = summaryRecords.size() > 0 ? summaryRecords.size() : 1;
Integer maxOppsToAllow = (MAX_ATTACHED_OPPS_FOR_QUEUABLE / divisor);
if (includeChildPayments) {
// If there are payment rollups, then assume at least one payment per opp, which effectively cuts
// the max number of records that can be queried in half
Expand Down

0 comments on commit 129439f

Please sign in to comment.