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
202 stars 27 forks source link

"Where clause entered incorrectly" error trying to run converted dlrs rollup #591

Closed sweinrarw closed 2 months ago

sweinrarw commented 2 months ago

I re-created this as a rollup using the core action just to confirm it wasn't something with the cmdt. parent is account, child records are contacts. The soql filter included is Statusc != 'Inactive' AND Statusc != 'Nonqualified' AND Account_Status__c !='Inactive' AND Account_Status__c !='Nonqualified'

Status__c is a picklist, Account_Status__c is a formula field so I'm wondering if that has something to do with the error? I took the formula field out and it was able to run successfully. I was able to run a soql query with that exact string included just to confirm i wasn't losing it. Full error received is below:

System.IllegalArgumentException: 
Where clause entered incorrectly: Status__c != 'Inactive' AND Status__c != 'Nonqualified' AND Account_Status__c !='Inactive' AND Account_Status__c !='Nonqualified' 
Exception: List index out of bounds: 13 Class.RollupEvaluator.WhereFieldEvaluator.recursivelyCreateConditions: line 392,
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.getFullRecalcQueryWrapper: line 2170, column 1 Class.Rollup.processCustomMetadata: line 2119, column 1
Class.Rollup.performRollup: line 847, column 1
jamessimone commented 2 months ago

@sweinrarw you need a space between the != and the last two conditions:

While no spaces is valid for SOQL, it's not valid within Apex Rollup's version of filtering. Thanks!

sweinrarw commented 2 months ago

ahhh derp, I didn't even notice that, must have been entered that way in dlrs and I never noticed! Thanks for the speedy reply

jamessimone commented 2 months ago

No problem!