jamessimone / apex-rollup

Fast, configurable, elastically scaling custom rollup solution. Apex Invocable action, one-liner Apex trigger/CMDT-driven logic, and scheduled Apex-ready.
MIT License
222 stars 30 forks source link

Error when merging Accounts #623

Closed baobao917 closed 2 months ago

baobao917 commented 2 months ago

Getting the following error when attempting to merge two Accounts: image

We couldn't merge these accounts. ApexRollupAccountTrigger: execution of AfterDelete caused by: System.IllegalArgumentException: Where clause entered incorrectly: (Age2c IN ('0-Current', '1-30 Days', '31-60 Days')) AND AcctSeedCustomerc = :recordIds AND Age2c IN ('0-Current', '1-30 Days', '31-60 Days') Exception: List index out of bounds: 19 Class.RollupEvaluator.WhereFieldEvaluator.recursivelyCreateConditions: line 396, column 1 Class.RollupEvaluator.WhereFieldEvaluator.createConditions: line 294, column 1 Class.RollupEvaluator.WhereFieldEvaluator.: line 239, column 1 Class.RollupEvaluator.getWhereEval: line 30, column 1 Class.Rollup.getWrappedMeta: line 2169, column 1 Class.Rollup.processCustomMetadata: line 2065, column 1 Class.Rollup.runFromApex: line 1762, column 1 Class.Rollup.runFromTrigger: line 1690, column 1 Trigger.ApexRollupAccountTrigger: line 3, column 1 Class.RollupEvaluator.WhereFieldEvaluator.createConditions: line 298, column 1 Class.RollupEvaluator.WhereFieldEvaluator.: line 239, column 1 Class.RollupEvaluator.getWhereEval: line 30, column 1 Class.Rollup.getWrappedMeta: line 2169, column 1 Class.Rollup.processCustomMetadata: line 2065, column 1 Class.Rollup.runFromApex: line 1762, column 1 Class.Rollup.runFromTrigger: line 1690, column 1 Trigger.ApexRollupAccountTrigger: line 3, column 1

What's also odd is that on both Accounts, there are no child billing records (which is what this rollup is referencing). We have v1.6.33 installed of ApexRollup.

baobao917 commented 2 months ago

Also confirmed it is not limited to these specific Accounts. Any Accounts I attempt to merge get this error.

jamessimone commented 2 months ago

@baobao917 good to hear from you, though I'm sorry it's under these circumstances. at the moment you can disable by setting Is Merge Reparenting Disabled to true on the org default rollup control record. I am trying to wrap up work on a few other reported issues at the moment so I won't get the chance to look at this issue this week. If it's alright with you, hopefully we can coordinate a time that I can take a look once I've finalized v1.6.34!

baobao917 commented 2 months ago

@jamessimone No worries. When you get a chance to look at it. I think you mean 'Is Merge Reparenting Enabled' = TRUE. It is already set to that. image

jamessimone commented 2 months ago

@baobao917 my mistake - you can uncheck that to unblock yourself in the meantime