The user is logged in into a community and there is a requirement to send a mail containing a link to the contact record of this user. So basically the need here is to get the salesforce org url (not community url) in the lightning component apex controller. Note: This URL should be got dynamically.

Had gone through various stites including the current with no solutions- 1)Get Org URL Via Web Service 2)Get Org URL from Lightning component


you can use this method to get Org URL in Community.you need to pass community/NtworkId.

Network.getLoginUrl('Community id');

or Use

String servUrl = URL.getSalesforceBaseUrl().toExternalForm();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.