Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for rollups on Account when doing Merge Account #303

Closed
afawcett opened this issue Feb 24, 2016 · 8 comments
Closed

Support for rollups on Account when doing Merge Account #303

afawcett opened this issue Feb 24, 2016 · 8 comments

Comments

@afawcett
Copy link
Collaborator

As per discussion on Chatter....

"I was testing this out by counting attachments on accounts which worked well. My question is if there is a way to trigger a recalculation upon merge? I have a lot of accounts that get merged daily, but the count didn't update after I did a test merge."

"HI @ben Patterson (Pentair Aquatic Systems) I seem to recall a help document that says that merge operations don't fire triggers. Here is the article: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_merge_statements.htm. It seems that a before delete or after delete action would fire the trigger, but I'm not sure how @andrew Fawcett (FinancialForce.com) has the triggers set up in Declarative Lookup Rollup Summaries Tool (e.g., can the tool capture a before delete action)."

"Hmm, it says no triggers for the related records are fired. That being said, we might be stuck."

"Thanks @[Kent Manning] yeah was just reading that as well, i think though this applies in the context of DLRS to the Parent object, where there is not a Apex Trigger deployed, thats only on the child. I'd need to do some testing to see whats going on here, as reparenting child records should work, i'm wondering if Salesforce is not firing the Apex Trigger on the child in this case of merge, i have some vague recollection this might be the case. Thats not to say we are dead in the water here, i'm up for considering updating the tool to deploy a trigger on the parent to support merge."

@afawcett
Copy link
Collaborator Author

Update: I have reproduced this in an Apex Unit test and am looking at a way to resolve.

@jongpie
Copy link

jongpie commented May 20, 2016

Just curious if there has been any progress on this - we're running into issues with several fields being out of date due to merges.

@afawcett
Copy link
Collaborator Author

Nothing as yet sorry @jongpie. It is marked as a priority enhancement, so when i or another contributor gets a burst of time it will get seen ahead of others.

@afawcett
Copy link
Collaborator Author

Ok started to explore this... its not going to be possible to get this to work realtime...

SELF_REFERENCE_FROM_TRIGGER, Object 001b000003O8CFqAAN is currently in a merge operation, therefore a trigger can not update it

Going to try this with Schedule Mode rollups...

@afawcett
Copy link
Collaborator Author

Ok, i think i have found a solution that allows the rollup to remain realtime most of the time, and switch dynamically to schedule mode in a merge scenario. This will require the RollupJob class to be scheduled, even if you don't have any Scheduled rollups.

@afawcett
Copy link
Collaborator Author

Added in v2.4.1.

@ChristiHarris
Copy link

ChristiHarris commented Feb 11, 2020

I'm running into this issue. We selected the "allow merging" box when we created it.

Here is a screenshot of the trigger that I'm pretty sure is causing the error (only one we've added/updated before getting the error):

Screen Shot 2020-02-07 at 10 51 19 AM

@afawcett
Copy link
Collaborator Author

afawcett commented Apr 6, 2020

@ChristiHarris can you please open a new issue and fill in the steps to reproduce etc. I am not quite sure from the above what it is you are saying is related to this issue and I think its best to start afresh. Thank you! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants