Tuesday, 7 June 2011

Welcome message for user when user loges into salesforce.

When i was exploring on home page components, i got an idea to show Welcome for user.For that i have write a small piece of code.
                We can create 3 types of homepage components
                                       Links
                                       Images
                                       Html Area.
 Where we can add Links and Images in Narrow space of homepage , html area is added to wide area of homepage . In Html Area we can write our custom Html code and we can display them in home page.
where i got an idea to show an popup/alert for user when ever he loges to salesforce.
I will explain you insteps please follow step by step


              1 .  Select Html Area component(Setup-->Appsetup-->Customize-->Home-->Home page components)
              2.  There you can find an check box " Show Html",Please select that and copy the following  code and save it as  "Homepagealert".
             
                <script>window.onload=get;
                      function get()
                      { 
                          alert('hai Hari');
                          url='/apex/user' ;
                          newwindow=window.open(url,'name','height=300,width=250');
                      }
                 </script>
              <h1>Flex And Salesforce Blog by Hari </h1>
In the above example i am showing an alert message and Vfpage as Popup.
Please find the Vfpage code:


     <apex:page wizard="true" >
             <Center><H2> Hello</H2><h1>{!$User.FirstName}</h1></center>
           <Center><B> Congratulations! You Have Successfully logged into Your Account</B</Center>
      </apex:page>


Save it. 
     Now goto Home-->Homepagelayout-->Click on Edit.
     Now you can find "Homepagealert"  in wide area section and select that and click on save. Now once logged out and logged in  to salesforce account click on home tab,you can find an alert/popup.

No comments:

Post a Comment