+ Start a Discussion
Sridhar BonagiriSridhar Bonagiri 

How to get currentpage url and pass this.

How can i find out currentpage url through apex.

public String getUrl() {

String host = ApexPages.currentPage().getHeaders().get('Host');

String url = Apexpages.currentPage().getUrl();

return 'https://' + host + url;


Sridhar BonagiriSridhar Bonagiri

thanks for reply.


But with that i am not getting correct url, it is giving some junk characters.




Could you please post the code that you tried.