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
Edward Scott 17Edward Scott 17 

rollup fields based on date

Hi All,

I am trying to create a rollup field from the opportunity to the account. I would like to be able to only roll up the amount of an opportunity if it has closed with in the last 30 days. I created a formula field on the opportunity but it will not allow me to use that in the rollup criteria. 

Is there any other way to accomplish this?

Thanks for your help,
Edward
Avinash GangadhareAvinash Gangadhare
Hi Edward - Salesforce doesn't provide a facility to use dynamic dates in roll-up criteria.

A workaround would depend on your requirement like if you want amount values summarized in Account field then you can have a batch which will run daily and update Accounts with its related opportunities values as per close date criteria and you need to write opportunity trigger if in between any opportunity closes it should update the related account field by adding its value.

If you don't want to store data on Account and just want to display on layout then you can add a report chart to page layout.

Thanks :)