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
sreenivas_cippyalisreenivas_cippyali 

how to get alert msg when we click on home tab

ex : when the user  clicks on home tab  i want an alert wishing him good morning 

Best Answer chosen by Admin (Salesforce Developers) 
Shivanath DevnarayananShivanath Devnarayanan

Well there is,

But this is what we need to do in order make the alert appear, We have to create a component of type HTML and then add it to the home page layout so that it runs everytime:

 

Here I'm going to walk you through the steps

 

Creating a Home Page Component

 

1) Navigate to "Your Name" --> Setup --> Customize --> Home --> Home Page Components

 

2) Click New on Custom Components

 

3) Continue to give a name to the Component (this will be displayed on the Layout, haven't found a way to do it invisible) and Type as HTML Area

 

4) Choose the Component Position (doesnt really matter), and main part is on the right hand top corner of the editor , Click the "Show HTML" Checkbox

 

5) Paste your Script there , This is what I tried out for testing

<script type="text/javascript">alert("Hello! I am an alert box!");</script>

 you can make it fancy and stuff...  SAVE IT

 

Adding the Component to the Layout.. Does not execute if you don't add it

 

1) I'm Assuming you use only one Homepage layout throughout the ORG (which may not be the case) , if you don't just have to follow these steps for the remaining layouts

 

2) Navigate to "Your Name" --> Setup --> Customize --> Home --> Home Page Layouts

 

3) Click on Edit for the Layout you want to show the alert on

 

4) There are 2 sections : 

Select Wide Components to Show

Select Narrow Components to Show

Your Component will show up on the section you chose on step 4 previously, Click the check box

 

5) hit Next and you may choose to arrange the components and That's it !! You''re Done !!

 

 

See if it works for you , If it does mark it as the answer so that somebody else may benefit from it, if it did not work get back to me

and we'll figure it out ..

 

Hope it helped !!