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

how to get alert msg when we click on home tab

ex: when the user clicks on home tab i want a alert msg that good morning <user name>

Best Answer chosen by Admin (Salesforce Developers) 



Try the below code snippet as reference:


Create a vf page with the following code

<apex:page >


var ss= '{!$User.Username}';

alert('Good Morning '+ss);



Create a home component with html area with following code

<iframe height="0px" width="0px" name="theIframe" src="/apex/displayconatactwithusername"></iframe>

Add the home component in the home page layout.


Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.