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
nwesoccernwesoccer 

Salesforce instance settings

I have a url to a callout, but wish that the url be different depending on which instance of salesforce i'm on.  I'm trying to call a different callout when I'm in the Sandbox than when I'm in Production.  Is there a global setting where that url can reside?

imuino2imuino2

I think this would help you
    public static String getDomain () {

        String hostname = ApexPages.currentPage().getHeaders().get('Host');
        String domain = 'https://' + hostname + '/apex';
       
        return domain;
       
    }

 

That method gives you the current host name where you are.

 

Ignacio.