How to find max recently closed activity on opportunity?

Modified on Fri, 22 Mar 2024 at 05:53 PM

Please follow the steps included below for creating a rollup to find max recently closed activity on the opportunity.


Note: Salesforce does not support any aggregate operations on the 'ActivityDate' field, but we have a workaround here to fulfill the requirement using PWR Rollups please follow the below steps for the solution


To achieve this requirement, the user needs to create a custom formula field. 

Create a formula field on the Task/Activity Object with return type Date, Formula = ActivityDate


  1. Open PWR Rollups application
  2. Create a new roll-up and give the appropriate name and description
  3. Select the source object as Task and the destination object as Opportunity, and click next
  4. Select the rollup type as Maximum and for the Source field select the formula field which you have recently created
  5. Select the destination field where you want to show the result (It should be the Date field)
  6. Now, click on the button Add Custom Filter
  7. Please refer to the screenshot below for the filter specifications
  8. Click on the toggle button to make rollup active then click on save


    Now you have successfully created the rollup to fulfill your requirement, please find the attached video for a better understanding of the steps for creating a rollup.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article