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
Sudha Kundathil MohananSudha Kundathil Mohanan 

Formulas practice problem

I am trying to finish the challenge in first chapter of formulas and validation in beginner trail(developer) to calculate the number of days between today and last activity date on a custom object.when I click on check challenge! I always get error message saying formula is incorrect.

here is the formula I did. TODAY()- LastActivityDate.
can anyone help?
William TranWilliam Tran
I looked at the Trailhead,  they want the difference between today and the account lastactivitydate

so the formula is:

Today() - Account.LastActivityDate

Thx
Sudha Kundathil MohananSudha Kundathil Mohanan
Hi William
Appreciate you help.Here is what I did to complete the challenge.
I created 2 custom objects, Account and Case.
I checked the Track activities checkbox to enavle the Last Activity Date Field in Account Object
In the Case object, added a custom field called 'Days Since Last Update'  as Formula field returning Number.
I entered the formula,TODAY()- LastActivityDate.(Probably here I'm wrong not mentioning account.LastActivityDate)
There was no Syntax error in the formula.
But when I check the challenge, I get the following message
Challenge not yet complete... here's what's wrong:
The 'Days_Since_Last_Update__c' formula field did not return the correct number of days between an Account’s Last Activity Date and today

I tried your version of formula also.
I get "Error: Field Account does not exist. Check spelling" error.
I'm unable to see Account Object when I try to insert field into the formula bar.
Request your help.

Thanks in advance.
Amit Chaudhary 8Amit Chaudhary 8
Hi Sudha,

You dnt need to create custom object account and case. You just need to use salesforce standard object Case.
Please follow below Step to complete this challange
Step 1:- Go to Setup--> case -> custom field.
User-added image
Step 2:- Then click on New Field and select formula field as Number
Step 3:- Then add below formula
(Today()- Account.LastActivityDate)
User-added image

NOTE:- API name should be same.

Pleas let us know if this will help u

Thanks
Amit Chaudhary
William TranWilliam Tran
Sudha, as Amit pointed you, you don't need to create custom objects, you just need to create a formula field in the case object with the formula:

Today() - Account.LastActivityDate

Thx

ps you should change the number decimal places to 0.
Anshuman Singh TomarAnshuman Singh Tomar
Hi All,

I am also facing the same problem. I used the Formula (Today() - Account.LastActivityDate) but when I click check syntax, an error message "Field AccountName does not exist. Check spelling." is displayed.

Can anyone pls help? I am stuck to complete this challenge.User-added image

Thanks in advance

Anshuman
Amit Chaudhary 8Amit Chaudhary 8
Hi [Anshuman Singh Tomar] Anshuman Singh Tomar,

I hope you are creating formula field on Case object
Anshuman Singh TomarAnshuman Singh Tomar
Thanks I got my mistake. I created Number data type
Ajay Patel 12Ajay Patel 12
i did't get that
Ajay Patel 12Ajay Patel 12
Still same message
 
Starr LimStarr Lim

Hi @Ajay, Just need to create formula under Setup > Case > Field. For the formula return type choose number and
the formula is (TODAY()  - Account.LastActivityDate). Hope this helps! :)

geoffrey bauer 1geoffrey bauer 1
Hi all,  same problem and message 'Error: Field Account does not exist. Check spelling.'  Entering number type and formula '(TODAY()  - Account.LastActivityDate)'
Creating custom CASE field. SEE the Last Activity Date displayed and working.
Been at 5+ hours. Any new advice?
geoffrey bauer 1geoffrey bauer 1
Now this message 'Challenge Not yet complete... here's what's wrong: 
The 'Days_Remaining__c' formula field did not return the correct number of days between the contract end date and today.'
Nida Shaikh 17Nida Shaikh 17
NEED HELP!!!!


Hello,

Create a formula field that determines the number of days between the end date of a contract and today.
Your renewals team wants to see how many days are left before a contract expires. Create a formula field that meets these requirements.
Object: Contract
Formula Return Type: Number
Field Label: Days Remaining
Field Name: Days_Remaining
Field Level Security: Visible and Read-Only for all profiles
Add the field to the standard Contract Layout page layout
The formula should return the number of days between the contract end date and today
The resulting API name for the field should be Days_Remaining__c
Challenge not yet complete... here's what's wrong:

This is a challeage:
I created below formulaes with Return type as Number 

Formula 1:
EndDate- TODAY() 

Formula 2:
IF(( EndDate   - today())>0,  EndDate   - today() , today()-EndDate)

none of these works.. does anybody know what could be the answer to the trail