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

1 Answer 1


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();

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .