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
210 stars 30 forks source link

Rollup fails with WHERE clause #489

Closed baobao917 closed 12 months ago

baobao917 commented 12 months ago

Hello! I'm new to Apex Rollup and have watched the videos/read the documentation and am having difficulty with setting up a rollup that has a where clause. The 1st rollup I created without a WHERE clause worked just fine. As soon as I added a second rollup that had a WHERE clause, none of the rollups worked. I recorded a video to help explain:

Video - https://www.loom.com/share/160334e8a99b45cfb6ba05b59713d164?sid=205aeeca-68b8-4cfa-843f-257f515db779

This is the error msg received: Billing Cash Receipt was not created for the following reason: ApexRollupBillingTrigger: execution of AfterUpdate caused by: System.QueryException: unexpected token: = Class.RollupRepository.get: line 50, column 1 Class.RollupCalcItemReplacer.potentiallyReplaceMissingBaseFields: line 155, column 1 Class.RollupCalcItemReplacer.replace: line 60, column 1 Class.Rollup.getRollup: line 2682, column 1 Class.Rollup.runFromApex: line 1718, column 1 Class.Rollup.runFromTrigger: line 1640, column 1 Trigger.ApexRollupBillingTrigger: line 3, column 1. Please apply the resulting cash receipt CR-03831 to the billing manually.

image

Also I followed the video and enabled logging so am attaching that here as well.

apex-07L3C00000Lr96sUAB.log

Pls let me know if you need more information. Thanks!

jamessimone commented 12 months ago

@baobao917 in Apex Rollup it's required that you have spaces between the field, the comparison operator, and the value(s) you're supplying in a where clause. Put a space between the field and the equals sign, and another space after the equals sign, and this will work

baobao917 commented 12 months ago

Thanks! That did the trick. The only thing I'd recommend is that bit of information be included here in the README.

image