• ABHIJEET BUDKE
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Hi All,
 I have one master (obj A) and 3 child object (ObjB,ObjC,ObjD) in look up relationship. Each child have Amt field and Mast have Final_Amount(ie sum of Amt all childs record) . I want whenever new record is created in any of child object sum of Amt field is get added\updated in master field.
Example
ObjB - 3 records Sum (Amt) = 40
ObjC - 2 records Sum (Amt) = 45
ObjD - 4 records Sum (Amt) = 50

So value in ObjA Final_Amounts should be  (40+45+50)= 135
Now one more entry is added in ObjD with Value 10 Then Final_Amounts  should be 145
First thought for this is Trigger on each 3 child object. But implementation\logic will be same for 3 trigger.(Want to avoid code same code repetition)
Is there any way I can achieve this with Trigger ?

Also please suggest some other way is there to achieve this.