How do I find the URL of a VF page?

How do I find the URL of a VF page?

Let’s get started, Step 1: Open Developer Console, Go to File>New>Visualforce Page and create a new Visualforce Page called GetURLParameter and replace the following markup….See also:

  1. Passing Parameter in Apex Method Using Javascript.
  2. Set PDF filename in Visualforce Page.
  3. Find IP Address Geolocation in Visualforce.

How do I find the current URL for Apex?

How To Get Current Page URL In Apex

  1. String urlVal = Apexpages. currentPage(). getUrl();
  2. public void getPageURL() {
  3. String hostVal = ApexPages.currentPage().getHeaders().get(‘Host’);
  4. String urlVal = Apexpages.currentPage().getUrl();
  5. String URLL = ‘https://’ + hostVal+ urlVal;
  6. }

How do I find my community URL in Apex?

Apex : Get Community URL

  1. Find out the URL prefix for your community. You can find the community URL prefix for a community on the experience page, from there there is a list of communities and their associated URL.
  2. Query the Site Object.
  3. Query the SiteDetail Object.

How can I get my community base URL in apex?

On a Visualforce page controller/extension, you can always grab the base URL using the URL class methods in apex: Thanks for contributing an answer to Salesforce Stack Exchange! Please be sure to answer the question. Provide details and share your research!

What do I need to link to an object in apex?

If you are looking to associate to a single record, you will need to use the PageReference class. Specifically: If you are looking to link to a specific object, you just need the host and the ID of that object. Say you want to link to an account for instance and the account you have is referenced by the acc variable:

How to get full URL from Apex Rest endpoint?

BTW – debugging apex REST can be facilitated by using SFDC Workbench and the REST Explorer option – you can paste in various rest resources with parameters and see how they work. e.g. as in @Samuel De Rycke’s answer below: /services/apexrest/smscallback?tranid=xxxx&messageguid=yyyyy&recipient=zzzzzzz&….etc.– cropredyJun 20 ’14 at 17:57

How to get the exact URL of a website?

To get the exact URL in a sites scenario I think you’d need to combine Site.getCurrentSiteUrl () with ApexPages.currentPage ().getUrl (), stripping out the /apex/ part in getURL. Not exactly sure what you mean about an extension. If it’s like a folder name, then yes that can be done when defining the site.