You need to sign in to do that
Don't have an account?
Jennifer Laing
Trigger to update Child Account Owners to Parent Account Owners when Child created
I have never created a Trigger before but I believe when I'm trying to achieve is (relatively!) simple?! I would like new Child Account Record Owners to have the same owner as the Parent Account Record Owner when the Child is created. Is this possible?
Here is a trigger I can offer which would satisfy your requirements.
Below trigger would work whenever accounts are inserted with parent account provided, it will automatically take parent account's ownerId into child account's ownerId.
Same goes for an update and Un-delete operation as well.
Trigger Code: Hope this helps and if it resolves the issue then kindly mark it as Best Answer!
All Answers
Here is a trigger I can offer which would satisfy your requirements.
Below trigger would work whenever accounts are inserted with parent account provided, it will automatically take parent account's ownerId into child account's ownerId.
Same goes for an update and Un-delete operation as well.
Trigger Code: Hope this helps and if it resolves the issue then kindly mark it as Best Answer!
1) Trigger itself
2) Test classes which gives code covergae to at least 75% of the trigger code.
Since this question is marked sovles, would you be able to create another question asking specific for test classes? Thank you.
Past the link here and I will try to follow up.