I had a scenario about 3 sObjects (Opportunity, CustomProduct, CustomSample).
Both CustomProduct and CustomSample had lookup field to Opportunity. Each sObject have triggers (immediately and future method).
When I insert/update CustomSample data. It also update Opportunity and CustomProduct. Because future method, we only can update all 3 data in ONE process.
If we want to seperate the process. What is the best practice about triggers and handle future method? I found some posts are providing good structure of triggers.
There are nothing about future method. Or the future method is not a good option?
If I am wrong, please give me suggestions.
Insert/update CustomSample Process includes as below:
CustomSample have before and after trigger, and after trigger will update Opportunity.
Opportunity also have before and after trigger. In after trigger, it will update CustomProduct directly and indirectly(future method).
CustomProduct have before and after trigger, too.