function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
nagarjuna gurajanagarjuna guraja 

Need Trigger for Apex

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.
 
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Nargarjuna,

If any revenue is updated or new contact is created then total revenue field need to be updated? Can you confirm if this is the scenerio.

Thanks.
 
nagarjuna gurajanagarjuna guraja
Hi Praveen, If we update three Revenue fields on contact then Total Revenue field value will be populated. Thanks