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

Rollup calc not triggering on delete of child record

baobao917 opened this issue · comments

Hi @jamessimone - Came across this issue where the rollup calculation isn't firing upon delete of a child record. It's firing fine when you manually delete a child record but in this example, the child record is being deleted via apex code from an integration when you unpost a related record. I recorded a video:

https://www.loom.com/share/3b4b2ade330d4c2dbe5e9546e4f78739

Pls let me know if you need any additional info or need access.

Thanks!

Another issue I've encountered (but unable to consistently recreate) is that sometimes when the child record (billing) is created (via apex from an integration when you post the record), out of the 3 rollups, sometimes only some of them are recalculating and sometimes none of them are recalculating. Not sure if it's related or if I should open a separate issue. Again, I'm unable to recreate consistently.

I will take a look! Apologies for the delay

@baobao917 thank you, as always, for the videos that you record. They're always helpful, and I'm quite grateful for the time that you put into them. As far as I know, there shouldn't be any difference between manually deleting a record versus deleting it through Flow/Apex - all such deletes would (should?) be firing your flow trigger.

The only thing I can think of, off the top of my head, is if your Unpost button is communicating with an API, and in turn receiving an API call from an external system that's set to run as a specific User and if that user was excluded from the Rollup Settings custom setting in some fashion. Since I'd imagine you have the setting configured at the organization level, that's probably not the case, but it's worth checking.

I'm happy to take a look myself if I can get access. I'd also think that whatever log messages get generated when you click Unpost might also help to clarify the situation. Let me know!

Hi @jamessimone - Thanks for looking into this. I don't think it's excluding a user since that user is me. I also recreated this issue logged in as other users. I have gone ahead and created a login for you, which you should have received the invite. Pls let me know if you aren't able to get in.

Below are details to assist in your investigation:

Pls let me know if you need anything else. Thanks!

@baobao917 I was able to start investigating this issue this morning. I haven't been able to fully pin down exactly why this version of delete works differently than the actual delete button, but I've made progress on exactly where things seem to be deviating, which is a promising start. I'll keep you updated.

@baobao917 this should all be fixed up. I finally was able to reproduce the issue after examining what was going on in your org - really appreciate that!

Thanks @jamessimone ! Verified it's working now after upgrading to v1.6.12