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

Child Object Where Clause not working with a flow #621

Closed techps closed 2 months ago

techps commented 2 months ago

I created the Custom Metadata Type for rolling up the number of payments (custom object) to Contact records (direct parent). For the "Child Object Where Clause" I set to Status__c NOT IN ('Cancelled' , 'Deferred', 'Opted Out'). When I run the recalculation everything works as expected, however, when I create a payment and a flow triggers, it omits the filter and counts all payments despite of the status. Here is the flow (when Payment is created or updated) image image

jamessimone commented 2 months ago

@techps your screenshot isn't showing the actual where clause, but try using the following:

Status__c NOT IN ('Cancelled','Deferred','Opted Out')
techps commented 2 months ago

@jamessimone Thank you, do you suggest to add the where clause on the flow? I have it on the custom metadata image

jamessimone commented 2 months ago

On the where clause is fine, I just think there's an issue with the trailing space and comma in it at present

techps commented 2 months ago

My bad, it appears there is a second trigger that does the calculation as well. Everything works as expected. Thank you!

jamessimone commented 2 months ago

No worries!