+ Start a Discussion
Janice HuJanice Hu 

Create child objects mapped to other object in opportunity

Hi, I am trying to create a trigger that will create child objects withing a custom object that are mapped to another object in the same opportunity.

For example, there is revenue $10K that is uploaded to custom object "Actuals" of an opportunity. Whenever revenue is uploaded, I want to create a child object or objects for each split partner of the opportunity. For example, if there are 2 split partners, then I would like 2 child objects to be created under that "Actuals" custom object and to calculate the amount of revenue that should go to each person. If it is split 50% each, then a child object will be created for person A with $5K and another child object created for person B with $5K. This happens each time a new "Actuals" is uploaded.

Could someone let me know if this is possible? If you have any suggestions for the code, that is appreciated. Thank you!!