ApexCallouts icon indicating copy to clipboard operation
ApexCallouts copied to clipboard

Use `Url.getOrgDomainUrl()`

Open jongpie opened this issue 5 years ago • 0 comments

Switch the RestApi class to start using Url.getOrgDomainUrl().toExternalForm(). From the docs:

  • "getOrgDomainUrl() always returns the same domain for your org, regardless of context. Use this method to build links to record URLs that work both in Lightning Experience and in Salesforce Classic, or as the domain when making API calls to your org."

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_url.htm

jongpie avatar Oct 17 '20 00:10 jongpie