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

COUNT_DISTINCT Falls Back to Default Value on Deletion #581

Closed PhilTerz closed 5 months ago

PhilTerz commented 5 months ago

I've set up a great-grandchild COUNT_DISTINCT rollup to count the Member__c (Contact lookup) field on an object Chapter Member underneath a State. It is working great for inserting those Chapter Member junctions, but on deleting one, the rollup field goes to blank (or zero if I enter the Full Recalculation Default Number Value).

My triggers for the objects Chapter Member, Chapter, and State program should all have the required trigger contexts. trigger ChapterMemberTrigger on Chapter_Member_JB__c(after insert, after update, before delete, after undelete)

Screenshot 2024-04-12 at 9 20 56 AM

When I change the Rollup Operation to just COUNT, keeping the triggers the same, both insert and delete is working fine.

jamessimone commented 5 months ago

I will take a look, I should be able to get to this by early next week. Thank you for reporting!

jamessimone commented 5 months ago

@PhilTerz this should be fixed as of #582 !

PhilTerz commented 5 months ago

@jamessimone Working as expected on my end. Thanks for such a fast turnaround!

jamessimone commented 5 months ago

Great news, thanks for letting me know