function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
saarbosaarbo 

Days Since Last Activity Formula

Hello,

 

I need to add a field to the lead detail page which calculates the number of days since the last activity for a lead. This formula would return a number which represents the number of days since the last task has been created, updated or completed. Does anyone know what this formula is?

 

Thanks,

 

Scott

Best Answer chosen by Admin (Salesforce Developers) 
kyle.tkyle.t

Should be

 

TODAY() -  LastActivityDate

All Answers

kyle.tkyle.t

Should be

 

TODAY() -  LastActivityDate

This was selected as the best answer
saarbosaarbo

Thanks! Looks like this works.

kyle.tkyle.t

You might want to mark the solution as solved.

Udaykiran Allika 6Udaykiran Allika 6
The 'Days_Since_Last_Update__c' does not exist
I got this error when I try to check the challenge. 
Any help appreciated 
Maggie StewartMaggie Stewart
I am having the same problem with that challenge. Do we need to create a new field? Days since last update? 
MuthunavaneethakumarMuthunavaneethakumar
Hi i too facing the same issue, though i got the expected right output by the formula TODAY() - DATEVALUE (LastModifiedDate), system says Date_since_last_modified does not return the correct number of days. We could not find a field called LastActivityDate from avaialble fields. How to get over this ? any help from experts here ?
Thanks in advance.
MuthunavaneethakumarMuthunavaneethakumar
Hello all, if u r getting this error in admin train head, this is was i got it now. You could be able to complete the challenge by adding the formula TODAY() - Account.LastActivity, but it did not update the column value for records when checked and returns only '-' value. if u need the exact output, TODAY() - DATEVALUE(LastModifiedDate) is the workaround. I am assuming lastmodifieddate=lastactivitydate here. Any suggestions are welcome. Thanks
Caitlin Verville 10Caitlin Verville 10
If you're going through the trail head it specifies the Account last activity so you'd want to do: Today () - Account.LastActivityDate
Brian HegerBrian Heger
I was having the same issue.  Use the below image to get the right field into the formula expression.  It's a bit confusing that they don't list the word 'Date' after Last Activity in this box, but it shows up as part of the field when selected.  Best to you all!User-added image
Andrew Day 5Andrew Day 5
I created the formula field and followed the ideas above and it says that Days_Since_Last_Update__c doesn't exist but i can see it. what am i missing? ive logged out and back in and no change
Helena LeeHelena Lee
You need to launch your hands-on org every time when you take a challenge
Yassine BouterhaYassine Bouterha
be sure you created a case field and not an account field. 
@Brian Heger: it works, thanks :)
Prasad N RPrasad N R
Build -> Cases -> Fields -> New Custom Field -> zero decimals -> TODAY() - Account.LastActivityDate as formula

"Moral": Be 'tenacious', 'work' almost for half an hour and do not create custom object
Reed HayesReed Hayes
I am getting
"Error: Incorrect parameter type for operator '-'. Expected Number, DateTime, received Date"
when trying all of these solutions.
Who would have thought formulas would be so difficult? I'm stuck on this trail now.
vasanthi doddavasanthi dodda
Hi . you can try as below. We would require to consider the last activity date API under accounts object.
TODAY() -   Account.LastActivityDate
Guillaume RuanGuillaume Ruan
Hi,
I am using this field but there's something I don't understand. Do you know exactly what is called activity? What is updating this field (call, emails, task, note...)? Because sometimes I can see that the account have no activity since 59 days but the commercial team sent an email to someone under this account 2 days ago. If we insert a note to a contact it is the same, this field does not update. If we log a call or create a task it s working fine. I am a little confused.
Thanks for the help.
John LombardoJohn Lombardo
I'm having the same issue.  
There are emails in my feed, but days since last activity are not counting them.  Is there something that needs to be done?
XixonudoXixonudo
TODAY() -  DATEVALUE(LastActivityDate)