You need to sign in to do that
Don't have an account?
nagarjuna guraja
Write a trigger for Apex
Hello Everyone,
We have two objects Account and Contact, We need to write a trigger such that Account has three child contacts, There is a field called "Revenue" on all three child contacts, and there is Field called "Total Revenue" on Account. If we update all three child contacts revenue field then automatically parent Account Total Revenue value should be populated.
Note:- If we update three contact Revenue fields then automatically Parent Total Revenue should be populated.
Thanks in advance!
We have two objects Account and Contact, We need to write a trigger such that Account has three child contacts, There is a field called "Revenue" on all three child contacts, and there is Field called "Total Revenue" on Account. If we update all three child contacts revenue field then automatically parent Account Total Revenue value should be populated.
Note:- If we update three contact Revenue fields then automatically Parent Total Revenue should be populated.
Thanks in advance!
Does this need to work only on update or for insert as well?
Based on this I can share the trigger for the same.
Thanks,
Can you try the below trigger.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,