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
Jacob W LandisJacob W Landis 

how to return to the full url instead of page in apex code

I have a page which trigger some actions(search for example) in the controller, the link likes
If I use "return null" at the end of the search method of the controller, the link will change to

So I tried to set

urlVal = Apexpages.currentPage().getUrl();
mypage = new Pagereference(urlVal);
In the controller and return to mypage in the search method, but it seems not working.

Any ideas?
kaustav goswamikaustav goswami
If possible please post the code from the page as well.

Hi Jingli,
Where you want it to go once search is complete.?
Jacob W LandisJacob W Landis
The url for my page is /******/GUMEDMentorPage?Mentoree=a1gK0000000twiJIAQ, after click search button on this page, I want the url is still be the same with parameter.