You need to sign in to do that
Don't have an account?
Sinka Tinko 1
Update child field from Parent using trigger.
Hi,
I have a field on Opportunity (parent_opportunity_owner) that needs to be updated with the parent opportunity owner(opportunity has a lookup relationship with opportunity using opportunity_parent field). I need to achieve this using a trigger. Can anyone help me out. Thanks in advance.
I have a field on Opportunity (parent_opportunity_owner) that needs to be updated with the parent opportunity owner(opportunity has a lookup relationship with opportunity using opportunity_parent field). I need to achieve this using a trigger. Can anyone help me out. Thanks in advance.
You can do the same using a FORMULA FIELD like this :
parent_opportunity_owner__r.Owner.FirstName
In case you have a scenario where you need to use the TRIGGER , here is a trigger :
Here FIELD is your custom field where you want to populate your Parent's Owner.
Mark solved if this helps.
Regards
Medhya Mahajan
All Answers
You can do the same using a FORMULA FIELD like this :
parent_opportunity_owner__r.Owner.FirstName
In case you have a scenario where you need to use the TRIGGER , here is a trigger :
Here FIELD is your custom field where you want to populate your Parent's Owner.
Mark solved if this helps.
Regards
Medhya Mahajan
Thanks for your reply. In Line 4, the parent_opportunity_owner__c is the field that needs to be populated.
On opportunity, there are two record types (Parent and Child). While creating Opportunity with Parent record type, parent_opportunity_owner__c field is not visible.
While creating Opportunity with Child record type, parent_opportunity__c (lookup to parent opportunity created above). So, a User can create a parent opportunity(record type parent) but another user can create a child opportunity (record type child) which has parent_opportunity_owner__c that needs to be populated with the parent owner (Opportunity created with Parent record type)
Thanks