Following are the two URL's which I have in my Org

base / Force.com URL - https://aura-venky-dev-ed.my.salesforce.com

Community URL - https://venky-partner-developer-edition.ap1.force.com/community2/s/

when I run URL.getSalesforceBaseUrl() the statement returns current instance URL. Here my question is how do I get force.com URL when I'm in the community.

  • 1
    have you tried anything so far? have you encoutnered any problems? I would suggest you update your post with your current code to further increase your chances of assistance. – glls Apr 9 '18 at 14:52

You can use getCurrentRequestUrl. It returns the page/community/instacne the request was fired.

  • Thanks for the input. Earlier I wasn't clear in my question. – Venky Apr 10 '18 at 6:05

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.