Could someone who knows better verify:
I just tested and it seems to me that if I merge –
- Account 1 with 2 opps (destination)
- Account 2 with 3 opps
…that the resultant Account 1 with all five opps does NOT benefit from having the Opps it obtained actually being "touched" (updated, edit/save, etc) officially (so no triggers/etc run). Is this true?
Is there a simple way to make this happen, perhaps a simple trigger that would say "if I detect my AccountID has changed, touch me" (at the Opp level)? Since it's not doing it by default, I am unclear how to code such a thing if SF itself doesn't even recognize that the Opp record has been updated (AccountID reference has changed after Merge).
Thanks!
Best Answer
From the Apex Developer's Guide:
Thus you could have a before delete trigger on the deletion of the losing records and figure out the children that will be affected. I suspect that you might need to have some co-ordination between the before and after delete triggers, such that the before figured out the affected children of a delete, and the after confirmed that they were being deleted as part of a merge and took appropriate action.