• DIVAKAR BABU 15
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 3
    Replies
1) Make two number fields on Opportunity object
Amount_X
Amount_Y

2) Make one picklist field "Type" , values ('Positive', 'Negative')

3) Make two number fields on account
Rollup_Amount_X
Rollup_Amount_Y
Rollup_Amount

4) Make one trigger on Opportunity object, which will do following:
--> Sum all child of Opportunity's field "Amount_X" and store in parent account's "Rollup_Amount_X" Where Type is "Positive"
--> Sum all child of Opportunity's field "Amount_Y" and store in parent account's "Rollup_Amount_Y" Where Type is "Negative"
--> Sum all child of Opportunity's field "Amount_X" + "Amount_Y" and store in parent account's "Rollup_Amount"

5) Make trigger as bulk / Test class