Q: How do I determine the last time a user completed an Activity tied to a record? A: DO NOT USE Salesforce’s built-in Last Activity Date. Last Activity Date can occur in the future.¹ INSTEAD: Define better Custom Fields on Activity, and create a Report from a Custom Report Type to roll that field up to the desired object. Perform these five steps:
DATEVALUE(IF(IsTask, CompletedDateTime, IF(ActivityDateTime + DurationInMinutes / 1440 < NOW(), ActivityDateTime + DurationInMinutes / 1440, Null)))
IF(Has_Date_MARKED_Complete__c, TODAY() - Date_MARKED_Complete__c,
IF(Activity.Has_Date_MARKED_Complete__c:MAX = 1, If you want the Report to return a 999 if no Activity has been marked Complete for this Opportunity, use this formula: Activity.Days_Since_MARKED_Complete__c:MIN ¹ Q: How can Last Activity Date occur in the future?
Out-of-box, Salesforce allows both
. . . so either Tasks or Events can make an Opportunity’s Last Activity Date return a future date. ² Q: Why are these fields needed? A: Two reasons:
|