Hi developer community,
I have the following trigger creating a child object when parent is saved. However, not all the field on the child object gets populated because they are only available on the child record.
trigger CreateBuyingInfluence on Opportunity_Positioning__c (after insert)
{
List<Buying_Influence__c> Childs = new List<Buying_Influence__c>();
for(Opportunity_Positioning__c a : trigger.new)
{
Buying_Influence__c Child = new Buying_Influence__c ();
Child.SCOP__c = a.id;
Child.Name = 'testName';
Childs.add(Child);
}
insert Childs;
}
So, I'm now trying to create a trigger that redirects me to the child page once parent is created/record saved.
When the Parent object=Opportunity Positioning is created then upon saving the record a trigger will prompt me to create Child Object=Buying Influences. Any ideas on how I can achieve this?
Thank you so much. Rog