• Sagar Nagvekar 20
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi,

I'm trying to implement a rollup summary with apex code but it's only working 95% of the way and takes a human click to finish the process, obviously I would like it to all happen at once. 

I have a custom object called "Participant Accounts" and then the standard object "Contacts". Each participant account under a contact is in fact a single mututal fund. We would like certain aspects of every participant account(mutual fund) to SUM up to the contact. The market value of each participant account SUMs and rollsup to the contact just fine as their total account balance. 

This is where it gets hairy(I think). Based on the summed total balance now on the contact, I made a formula field back under participant account that divides its own market value by the contacts total account balance so that I know what percent that participant account is of the total balance for the contact. I then multiple the new number by 3 fields I have previously set up under participant accounts which are Equity, Fixed Income, or Cash. If a mutual fund(participant account) is 100% equity then 100 goes in equity, 0 in fixed income, and 0 in cash. I think you can see how that goes on. 

At this point I know how much each partipant account(mutual fund) is of the total balance is as well as how much it is of total equity, fixed income, and cash holdings. The equity, fixed income, and cash rollup to the contact as they are supposed to but don't add up correctly initially. It takes me opening any participant account(not changing anything) and just saving for the rollup to then work. 

Is there something simple I'm missing to put into coding to have it update both participant accounts(or contacts?) to have it add correctly the first time around?

I'm extremely new to all of this but it appears that the back and forth formulas are the hang up.. maybe.

Thank you in advance. I have code if needed.

James