Play Games

Search This Blog

Friday, November 13, 2015

Get Salesforce Instance Url

Apex Class :
public class SalesforceInstanceUrlGenerator {
    public string instanceUrl {get;set;}
    public SalesforceInstanceUrlGenerator () {
        instanceUrl = System.URL.getSalesforceBaseUrl().toExternalForm();
    }
}
Visualforce Page :
<apex:page controller="SalesforceInstanceUrlGenerator">
       <B>Salesforce Instance Url</B> :{!instanceUrl}
</apex:page>

Output :

No comments:

Post a Comment