This is quite simple to get but some developer used to hard code that instance url, Actually we should not hard code url like "https://cs12.salesforce.com" because it differs from org to org.
Use below code to get instance url in apex class dynamically.
String baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
No comments:
Post a Comment