3

In Salesforce Trailhead there is one Challenge available. Please find the challenge description below

To complete this challenge, use some of the strategies and function you learned in this unit to return the day of the week as a text string.

  • The formula should be on the Contact object
  • The formula should be of return type Text
  • The formula should be named 'Day of the Week' with the resulting API name 'Day_of_the_Week__c'.
  • The formula should return the day of the week as a string—”Monday,” “Tuesday,” and so on

I tried the following formula

CASE(MOD( TODAY() - DATE(1900, 1, 6), 7), 0, "Saturday", 1, "Sunday", 2,"Monday", 3, "Tuesday", 4, "Wednesday", 5, "Thursday", 6,"Friday","")

It returns the following error

Challenge Not yet complete... here's what's wrong: The 'Day_of_the_Week__c' is not reporting the correct day of the week (Monday, Tuesday, etc.)

What is the problem ?

1
  • the above formula seems correct to me and it is returning the right day! Have you checked the formula value on contact records? Dec 31, 2015 at 5:54

4 Answers 4

6

I had the same issue.

Seems the Trailhead Validation engine is looking only for the Day in US timezone

My Dev Org is in AP instance and my user timezone is in ANZ, so the day returned in the formula is usually a day ahead of the day in US.

The only way I could get thru is to return the previous day for my current timezone and it worked.

I've posted this in the Success Trailhead Group, but no response yet.

Note - I think in your Formula Text field, if you simply return the current day in US (without having the actual formula), the trailhead validation might let you thru.. I didn't try this & its not recommended either.. :-)

4
CASE(MOD(Today()- DATE(1900,1,7), 7), 0, 'Sunday', 1, 
'Monday',2,'Tuesday',3,'Wednesday',4,'Thursday',5,
'Friday',6,'Saturday','error')
1

Challenge Not yet complete... here's what's wrong: The 'Day_of_the_Week__c' is not reporting the correct day of the week (Monday, Tuesday, etc.)


In case of this error Do not worry as only changes you have to do is to change the Indention of the days Check this formula:

CASE(MOD( TODAY() - DATE(1900, 1, 6), 7), 0, "Sunday", 1, "Monday", 2,"Tuesday", 3, "Wednesday", 4, "Thursday", 5, "Friday", 6,"Saturday","")
0
0

I ran into the same issue, for me if I check the challenge in the morning it passes but in the evening it does not, so just try at a different time in the day.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .