The goal of this blog is to help you get the best return on investment from your Salesforce instance. Typically, that means introducing newcomers to tools they may not be aware of while giving more experienced readers little tricks to help hone what they already know. This week is no different, though some of you in the experienced camp might find yourselves in a different position this week. There’s a sneaky field a lot of people don’t realize is hiding in the corner of your Salesforce org that can play a huge role in your day to day operations.
Even though you can’t add it to your page layouts, the Last Activity field is available for Accounts, Contacts, and Leads in Reports, List Views, Formula Fields, and Apex. Last Activity tells you the last time an Activity was logged for a record – whether it was an in person meeting, call, or email. If you’re trying to set up a call list for your team, Last Activity can be used to help isolate clients or prospects who haven’t heard from you in a while or report on who got your attention recently. Creating a simple formula field called Days Since Last Touch with the value of:
IF( ISNULL(LastActivityDate),
MIN( TODAY() - DATEVALUE( LastModifiedDate ),TODAY() - DATEVALUE( CreatedDate ) ),
MIN( TODAY()- LastActivityDate , TODAY() - DATEVALUE( LastModifiedDate ),TODAY() - DATEVALUE( CreatedDate ) ) )
sweetens the pot with an easy way to see who needs to hear from you. For more details on how Last Activity is calculated, check out the details here, and enjoy leveraging this oft forgotten, powerful tool!
-Jared and the Salesforce Guys
CEO of CloudMyBiz Salesforce CRM consulting services with a deep knowledge in the lending industry. Taking keen interest in the project management side of operations, playing a vital role in the 31% YOY company growth. Strategic leader, mastering the ability to problem solve at every level of the business, providing effective solutions for clients.
Does this still work? my records are updating and displaying last touch for activity but not last modified dates or created dates
Hi @Michael,
After reviewing the formula, I’ve found a limitation which I think the below should resolve. While there is always going to be a Created Date and Last Modified Date for a record, Last Activity Date can be null if no contact has been made, and this formula was initially developed in my org, where we have a policy to always reach out to a contact upon creation. When there is a null value in the Last Activity Date, the formula evaluates to null. The below accounts for that, and I’ll be updating the article momentarily to account for this issue. Thanks for your question!
IF( ISNULL(LastActivityDate),
MIN( TODAY() – DATEVALUE( LastModifiedDate ),TODAY() – DATEVALUE( CreatedDate ) ),
MIN( TODAY()- LastActivityDate , TODAY() – DATEVALUE( LastModifiedDate ),TODAY() – DATEVALUE( CreatedDate ) ) )