+ 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,
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 :)