You need to sign in to do that
Don't have an account?
Shikibu
OpportunitySplit : send email to opportunity team upon any change
I'm stumped by this, because there may be multiple triggers fired. Really what I want is a trigger on the opp when any related opportunitysplit is inserted, updated, or deleted (that's how OpportunityLineItem works). But OpportunitySplit does not seem to fire Opportunity triggers.
I can't figure out how to use the OpportunitySplit trigger, because multiple triggers may fire (insert, update, delete), and I only want to send one email when any aspect of the OpportunitySplit changes.
I can't figure out how to use the OpportunitySplit trigger, because multiple triggers may fire (insert, update, delete), and I only want to send one email when any aspect of the OpportunitySplit changes.
I guess the best approach is to create a new trigger on OpportunitySplit handling all those events you told. Try this code:
You just need to add your logic to send the email.
Let me know if I can help with anything else. If you find the solution useful, please mark as Best Answer to help others developers too.
Regards.
The trigger has to be invoked three times, since you are handling three different events. The only solution I can imagine for your case (assuming you want to email team members only once), is to schedule a job that will run in the frequency you desire (once a hour, once a minute, etc.).
So to archieve that, you have to create a new custom field on Opportunity (IsSplitChanged__c) wich will be writter by OpportunitySplitTrigger.
Please consider the following code:
Trigger Schedulable