I am operating in an org: https://myorg.lightning.force.com
. If I call URL.getSalesforceBaseUrl()
from an apex class I get the base org URL back. If I then use the same command in a controller for a lightning component in a community I get the community's base URL: https://mycommunity.aa11.force.com
.
Any ideas on how I can get the Org URL (https://myorg.lightning.force.com
) in a lightning component dynamically?
Best Answer
Sorry for reviving an old post, but I was trying to find the same answer as OP and wanted to provide my solution for anyone else who might stumble upon this post: