+ Start a Discussion
William Terry 12William Terry 12 

Trail Head Challenge DisplayUserInfo using dynamic global variables

Can anyone suggest a fix? Thanks in advance for your help.
<apex:page showHeader="false">
<apex:pageBlock title="User Status">
<apex:pageBlockSection columns="1">
{! $User.FirstName } {! $User.LastName } ({! $User.Username })
</apex:pageBlockSection>
</apex:pageBlock>
</apex:page>

Challenge not yet complete... here's what's wrong: 
The Visualforce page did not fit the criteria. The first name of the logged in user was not output using dynamic global variables.

 
Best Answer chosen by William Terry 12
Gaurav KheterpalGaurav Kheterpal
Remove the spaces from
 
{! $User.FirstName } {! $User.LastName } ({! $User.Username })


to
 
{!$User.FirstName} {!$User.LastName} ({!$User.Username})

and you should be good to go.

If my answer helps resolve your query, please mark it as the 'Best Answer' and upvote it to benefit others and improve the overall quality of Discussion Forums.

Gaurav Kheterpal
Certified Force.com Developer| Developer Forums Moderator| Dreamforce Speaker




 

All Answers

Gaurav KheterpalGaurav Kheterpal
Remove the spaces from
 
{! $User.FirstName } {! $User.LastName } ({! $User.Username })


to
 
{!$User.FirstName} {!$User.LastName} ({!$User.Username})

and you should be good to go.

If my answer helps resolve your query, please mark it as the 'Best Answer' and upvote it to benefit others and improve the overall quality of Discussion Forums.

Gaurav Kheterpal
Certified Force.com Developer| Developer Forums Moderator| Dreamforce Speaker




 
This was selected as the best answer
sfdcdevsfdcdev
Hi William,

It is asking only user's first name.

Challenge: Create a Visualforce page that displays the first name of the logged-in user.
  1. The page must be named 'DisplayUserInfo'.
  2. The displayed user information must be generated dynamically from the logged-in user.

Here's code:


<apex:page >
         {!$User.FirstName}
</apex:page>

 
Manivel GManivel G
Thnk u
Peter Wang 23Peter Wang 23
Greate, thx 4 your issue