function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sridhar BonagiriSridhar Bonagiri 

How to get currentpage url and pass this.

How can i find out currentpage url through apex.
prageethprageeth

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.

prageethprageeth

unbelievable..!!!!!

 

Could you please post the code that you tried.