Tuesday 3 February 2015

Global Variables In salesforce

Use global variables to reference general information about the current user and your organization on a page.

More Info about Global variables follow below link.

http://www.salesforce.com/docs/developer/pages/Content/pages_variables_global.htm




                       Global Variable info on visual force page

 

<apex:page standardController="Account" extensions="DemoController" sidebar="false"> 
<apex:form >  

   <apex:pageblock >  
       <center>

            <b> Userid :  <apex:outputText value="{!LoggedInUSerId}"/> <br></br> </b>

           <b> User Name : <apex:outputText value="{!uname}"/> <br></br> </b>

           <b> profilename : <apex:outputText value="{!$Profile.Name}"></apex:outputText></b>

           <b> User Name : <apex:outputText value="{!$User.LastName}"/> <br></br> </b> 

           <b> User Role: <apex:outputText value="{!$UserRole.Name}"/> <br></br> </b>

            <b> Static Recourse : <apex:outputText value="{!$Resource.bulbon}"/> <br></br> </b>

           </center>        

    </apex:pageblock>

  </apex:form>

</apex:page>

 ----------------------------------------------------------------------------------------------------------------

public class DemoController {

    public id LoggedInUSerId{get;set;}
     public string uname{get;set;}
    public string pname{get;set;}

  public DemoController(ApexPages.StandardController controller) {
     LoggedInUSerId = userinfo.getuserid();
     uname = userinfo.getusername();

    }
}
 

No comments:

Post a Comment

Complete Salesforce CPQ training Free videos

Salesforcestart:: We are excited to announce that our YouTube channel, Salesforcestart, is your one-stop-shop for all things Salesforce CPQ!...