• cmerrill
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

I need to find out what the ENTIRE url of the calling page is in VF, so that I can return to that URL.

 

I can't append the retUrl to the querystring on the button because &retUrl=%2F{object__c.Id} doesn't include the base url. 

 

I can't derive the retUrl from the object's record ID because I don't know the base URL and the base URL will change depending on circumstances.

 

I can't use ApexPages.currentPage().getHeaders().get('Referer') because that just returns "/". I thought maybe I was spelling "referer" wrong -- because it is actually spelled "referrer" in the HTML spec so I tried that, too, and it returned an empty string.

 

I can't use ApexPages.currentPage().getHeaders().getUrl() because that returns the CURRENT url.

I can't use ApexPages.currentPage().getHeaders().get('Host') because that returns the CURRENT host, and the current host is some weird VF thing instead of https://na*.salesforce.com.

 

And I can't use javascript (document.referrer) because that just returns an empty string, too.

 

I need a result that looks something like this: https://na6.salesforce.com/a0580000005XeTg

 

How can I do this?

 

TIA,

 

John