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
Katrenia HardestyKatrenia Hardesty 

Need Help with Trailhead Formula Challenge Error

Hi I've been trying to work on the challenge to use a formula to calculate the number of days between the last activity date and today, of an account tied to a case. This is what I put and checked the Syntax, which said there was no error. See below screen shot.
User-added image

However when I click on the "Check challenge" button, it gives me this Challenge Error:
User-added image

Can anyone please help me to understand why the syntax shows ok, but the challenge shows an error? Also if the formula is incorrect, what is correct so that I can learn the right way? Thanks for any help!
 
Amit Chaudhary 8Amit Chaudhary 8
Please create one formula field with Number type on case object like below
(Today()- Account.LastActivityDate)
User-added image
Same worked for me. Please share your screen shot if above will nt help u 
Please refer below post for more info
https://developer.salesforce.com/forums/ForumsMain?id=906F0000000BQwUIAW

NOTE:- we need to find out the difference between two date here

Please let us know if this will help u
 
Sitarama MurthySitarama Murthy
Today() - Account.LastActivityDate,
This is the correct working formula.
Katrenia HardestyKatrenia Hardesty
Thank you, I had the formula backwards because today's date, being the larger, needed to go first. Is this correct? I am trying to understand and not just accept.
Amit Chaudhary 8Amit Chaudhary 8
Yes today is big date and LastActivityDate will always be a past date or current date.
So when ever you will minus from big date you will get and in +ve other wise result will be in -ve.