jamessimone / apex-rollup

Fast, configurable, elastically scaling custom rollup solution. Apex Invocable action, one-liner Apex trigger/CMDT-driven logic, and scheduled Apex-ready.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Grandparent rollup not triggering when intermediate (parent) object is deleted

baobao917 opened this issue · comments

This is an offshoot of #518 .

In a grandparent rollup, when deleting the intermediate (parent) object, the grandparent rollup is not triggered to recalculate.

Pls see video - https://www.loom.com/share/406c617a4e9044da8d3e97b26dcf3eee?sid=7ea55bff-8786-4e3a-bb3d-3209dc5ec0d7

Yup, this is a great call out. I'm working on the fix for #518 at the moment - once that's fixed, it will be easy to fix this one.

@jamessimone I tested this fix against v1.6.2 and this issue is now fixed (when deleting the intermediate object, the grandparent rollup is triggered to recalculate). I did notice two other issues and wasn't sure if I should break them out into new separate issues or re-open this one:

  1. When the roll-up calculation is performed AND rollup is configured to default to zero on a full recalculation, it is leaving the rollup field as blank instead of populating with zero (if there are no child records).
  2. When restoring the deleted intermediate record, the rollup isn't triggering a recalculation.

I recorded a video
https://www.loom.com/share/29b0706976a84fe29fbc993acfe2966b?sid=fe64b967-5781-4e53-bff1-0f5cb1e22c24

  1. Ah yeah, that's a good callout. That will be an easy fix
  2. Remind me, you switched over to using Apex when calling Apex Rollup, right? Undelete is only supported there. Restoring records comes up so infrequently I totally forgot about it for intermediate parents in a grandparent rollup. I can get that fixed

@jamessimone I tested this follow-up issue (bullet below) against v1.6.3 and it's now working as expected. Thanks!

  • When the roll-up calculation is performed AND rollup is configured to default to zero on a full recalculation, it is leaving the rollup field as blank instead of populating with zero (if there are no child records).

Ah yes - I need to create another issue off of this one for the undeletion part of this