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
AniltAnilt 

Welcome username (dynamic display) in customer portal

hi everyone,

 

I want to display username dynamically (something like "Welcome xxxxx") in the customer portal header, when a customer logged in. Please help me regarding this.

 

Note: I've gone through that and observed that header cannot be changed with VF and CSS, HTML doesnot support dynamic displaying of this username.

 

Best Answer chosen by Admin (Salesforce Developers) 
AniltAnilt

I've added the VF Page url in the iframe shown below and added this in the home page component, Now I'm able to show the Profile page whenever customer has logged in rather than approaching welcome component

 

you also had the same requirement, go to customize -> home -> Create new Custom Components -> check 'HTML Area' and provide a name -> check wide (Right) column -> add the below code

 

<iframe src="/apex/myprofile?core.apexpages.devmode.url=1" frameborder="0" height="500" width="100%" marginheight="500" align="left" marginweight="100%" scrolling="no"></iframe>

All Answers

Boman@imtBoman@imt

Get the User info in your controller like:

 

User user = [SELECT id, email, username, usertype, communitynickname, timezonesidkey, languagelocalekey, firstname, lastname, phone, title,
                street, city, country, postalcode, state, localesidkey, mobilephone, extension, fax, contact.email
                FROM User
                WHERE id = :UserInfo.getUserId()];

 

Access any/all User fields in your VF page, and display.

AniltAnilt

I've added the VF Page url in the iframe shown below and added this in the home page component, Now I'm able to show the Profile page whenever customer has logged in rather than approaching welcome component

 

you also had the same requirement, go to customize -> home -> Create new Custom Components -> check 'HTML Area' and provide a name -> check wide (Right) column -> add the below code

 

<iframe src="/apex/myprofile?core.apexpages.devmode.url=1" frameborder="0" height="500" width="100%" marginheight="500" align="left" marginweight="100%" scrolling="no"></iframe>

This was selected as the best answer