Activity Forums Salesforce® Discussions How to display the browser Current URL in Visualforce Page

  • How to display the browser Current URL in Visualforce Page

    Posted by Deepak on October 11, 2019 at 12:56 pm

    How to display the browser Current URL in Visualforce Page

    Laveena replied 5 years ago 2 Members · 1 Reply
  • 1 Reply
  • Laveena

    Member
    October 11, 2019 at 1:02 pm

    Hi Deepak,

    If your page is using a controller or extension (if it's not, just create an extension) then you should be able to get the URL you're after using the referer header for the Visualforce page.

    Use the following method to get the URL:

    public String getReferer()
    {
    return ApexPages.currentPage().getHeaders().get('referer');
    }
    Then you can just get this in your page using:

    <apex:outputText value="{!Referer}"/>

    Thanks

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos