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
sliptonslipton 

Roll Up Date based on Largest Opportunity Amount

Hi,


I've used roll up fields, formula fields and workflow rules to come up with a solution to the below requirement yet it seems to only work on some accounts and I can't work out why!

 

Requirement:  Show the Renewal Date (a custom date field on opportunity) on the account object for the opportunity that has the largest amount.


What I've done to solve it so far:

 

- A roll-up summary on the account for the max opportunity amount.

- A formula field ("Largest Amount Indicator") on the opportunity that checks the account max opportunity amount and compares it to the opportunity amount.  If they are equal, it's set to 1.  If not, 0.  This works on some opps but not others for some reason.

- I then have a roll-up summary on the account object for the min date where the opportunity "Largest Amount Indicator" equals 1.

- I also have a workflow rule updating a text field on the opportunity with the same value as the "Largest Amount Indicator" formula field as the roll-up summaries don't let me reference formula fields.  This update is happening everytime an opportunity is edited/created and its created date is not equal to NULL.

- As a note, I have multi currency on but not Advanced Currency management.

 

As I said above, the Key Renewal Date on account is sometimes working but other times it's not.  The Max Opportunity amount always works and I can see that on each account.  When I go into the corresponding opportunity to check that the Largest Amount Indicator is showing a 1, it shows zero, even though the amount is equal to the Max Opportunity amount on the account.

 

I'm stumped.  I hope what I've written makes sense.  My solution seems sound to me and it's verified by it working on some accounts but I can't for the life of me work out why others aren't working.  An extra brain is surely appreciated here.

reidjnreidjn

Slipton,

 

I suspect your running into a situation where the formula field on the opportunity object is evaluating PRIOR to the roll-up being calculated/finished for the account. The Roll-up summary field can take time to calculate. I think this is the reason why it sometimes works.

 

There is a silver lining though. This problem has already been solved with another solution that runs in real-time, for all your records, and it does not require multiple rollups, formula fields, and workflow to orchestrate. I would recommend purchasing Rollup Helper - Enterprise Edition to solve this problem. The other option is an Apex trigger, but why code when you can click!

 

Regards,


Jerry Reid

Passage Technology

 

 

sliptonslipton

Thanks for your solution but I'm still not convinced.  Assuming you are correct, why doesn't it work when I manually go back to opportunities that are showing a 0 and I edit them and it still doesn't work?  The account is showing a value in the "Max Opportunity Amount" field and so it should compare but it doesn't.  I don't understand why?

reidjnreidjn
I am not sure why. Perhaps you can try Rollup Helper and see if that will work for you?