0

I have an issue. I have last activity age by using (Today()-Lastactivityage) to calculate last activity age. But I want to segregate it as last task age and last Event age. I have two custom field on opportunity last task age and last event age. I want age of last task when it was done or upcoming. same with event

How can I get these to age in opportunity. Please help!

1 Answer 1

0

I personally would use declarative-lookup-rollup-summaries to implement LastTaskDate__c and LastEventDatetime__c fields. Here's how you would set up a Lookup Rollup Summary for the Task field:

  • Parent Object: MyObject__c
  • Relationship Field: WhatId
  • Child Object: Task
  • Field to Aggregate: ActivityDate
  • Field to Order By: ActivityDate
  • Aggregate Operation: Last
  • Aggregate Result Field: LastTaskDate__c

Note that you must set the same Field to Order By as Field to Aggregate if you want to use the Aggregate Operation options of First or Last. Setting up a summary for Event is almost exactly the same:

  • Parent Object: MyObject__c
  • Relationship Field: WhatId
  • Child Object: Event
  • Field to Aggregate: ActivityDateTime
  • Field to Order By: ActivityDateTime
  • Aggregate Operation: Last
  • Aggregate Result Field: LastEventDatetime__c

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .