Salesforce Base URL

//To find Salesforce Base URL

//Till API Version 58.0
system.debug('@@@@' + URL.getSalesforceBaseUrl());

//After API Version 58.0
system.debug('@@@@' + URL.getOrgDomainUrl()); //Canonical URL
system.debug('@@@@ ' + URL.getCurrentRequestUrl()); //URL of an entire request

For more information, please check the URL Methods.

Unknown's avatar

Author: Jyotirmay Paul

A tech enthusiast!

Leave a comment