• James Sherrard0742540083538499
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    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
I apologize in advance if I don't give enough information or the question isnt clear. I'm new to apex and not sure if this needs to be accomplished via a trigger or a class. 

I grabbed what appears to be a pretty well used trigger and class for rolling up fields from a custom object and customized the trigger for my needs. It works, sort of. I think my issue is because I have some formula fields that feed back and forth between the standard "Contact" object and my custom object for maybe 2 round trips. 

The outcome of the issue after the trigger runs is that I have to go into the custom field, open a record but not actually change anything, save the record, and then the outcome is correct. Is there anyway to force an update of all the objects involved either via a trigger or class? So what is more or less a fake update of a record doesn't have to be done.

I can attach any info needed. 

Thanks,

James
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
I apologize in advance if I don't give enough information or the question isnt clear. I'm new to apex and not sure if this needs to be accomplished via a trigger or a class. 

I grabbed what appears to be a pretty well used trigger and class for rolling up fields from a custom object and customized the trigger for my needs. It works, sort of. I think my issue is because I have some formula fields that feed back and forth between the standard "Contact" object and my custom object for maybe 2 round trips. 

The outcome of the issue after the trigger runs is that I have to go into the custom field, open a record but not actually change anything, save the record, and then the outcome is correct. Is there anyway to force an update of all the objects involved either via a trigger or class? So what is more or less a fake update of a record doesn't have to be done.

I can attach any info needed. 

Thanks,

James