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
DanLambDanLamb 

Using Simple Variables and Formulas

I am going through the Trailhead lessons and for some reason am hung up on this one.  The test is to:
Create a Visualforce page that displays the first name of the logged-in user.
* The page must be named 'myHelloWorldVF'.
* The displayed user information must be generated dynamically from the logged-in user.

The code I have for this is:
<apex:page >
    {! $User.FirstName}
</apex:page>

For some reason Trailhead keeps coming back with the error:
The Visualforce page did not fit the criteria. The first name of the logged in user was not output using dynamic global variables.

Can anyone give insight into what I am doing wrong?  Not looking for the answer, just guidence in what needs to be looked at.

Thanks!
Best Answer chosen by DanLamb
Frédéric TrébuchetFrédéric Trébuchet
Hi,
Just replace like this
<apex:page >
    {!$User.FirstName}
</apex:page>

(white space removed befor $User).

Regards,
Fred

All Answers

Frédéric TrébuchetFrédéric Trébuchet
Hi,
Just replace like this
<apex:page >
    {!$User.FirstName}
</apex:page>

(white space removed befor $User).

Regards,
Fred
This was selected as the best answer
DanLambDanLamb
Thanks Fred! That worked. In the tutorial it called out that spaces after the ! are not looked at and they even have the examples with the spaces so just really odd. Thanks again!
Frédéric TrébuchetFrédéric Trébuchet
Great,
Don't forget to mark this question as Solved and to choose the best answer ;)

Thank's
Fred
Salesforce AnswersSalesforce Answers
A video showing the solution to this challenge is located here. ======> https://www.youtube.com/watch?v=wFCH1L9ygSA

                        --- Salesforce Answers