You need to sign in to do that
Don't have an account?
Carl H
How to get salesforce Host name from Apex Class
Hi all,
I'd like to get salesforce URL (https://na2.salesforce.com) inside Apex class, may i know what is the syntax.
i tried the "ApexPages.currentPage().getParameters()" but it only return me the parameters at behind, how to get the host name?
I'd like to get salesforce URL (https://na2.salesforce.com) inside Apex class, may i know what is the syntax.
i tried the "ApexPages.currentPage().getParameters()" but it only return me the parameters at behind, how to get the host name?
the ApexPages.currentPage().getUrl() only return the short URL, exmaple /apex/myVFPage.
and not full URL like http://na2.salesforce.com.....
ApexPages.currentPage().getHeaders().get('Host') should do the trick.