You need to sign in to do that
Don't have an account?
Dinesh Kumar Wickramasinghe
Get Org URL Via Web Service
I've created a REST web service on Salesforce and exposed it as a public service (Using Sites). Now I am consuming this service from an external web site. I need to get the Salesforce base URL inside this web service code (Apex) to populate a dynamic URL. I used,
I need to get the actual base URL which I see when I logged in to my Org. Appreciate your support.
String baseUrl = System.URL.getSalesforceBaseUrl().toExternalForm();When I call the web service from the external site, this returns always the custom URL I added for the site (Web Service), but not the real base URL which I see when I logged in to the Org.
I need to get the actual base URL which I see when I logged in to my Org. Appreciate your support.
I think it's better for you to hold the URL for specific Org in a custom setting and change it according to the base of the ORG.
Thanks,
Nagendra
Thanks for the reply. I also thought the same and guggested this option to my client. But he is looking for more dynamic solution.