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
DeveloperSudDeveloperSud 

Urgent Help: Redirect back to search result after clicking 'Back'


Hi Guys,
Need your help on the below situation.
I have a page which is showing "List of Cases" for my organisation.I have added few filter fileds like date range ,staus etc so that I can refine the case list based on my requirement.If I click on any case from the list it should redirect to case detail page and in case detail page I have a "back" command link which will take us to orginal "List of Cases"page on clicking.
Now the requirement is if I apply case filter data range as yesterday's date to today's date and it retuns 1 case, after clciking on that case it should redirect to the case detail page as mentioned before and after clicking the back command link in case detail page it should redirect back to refined serach result (it should show that 1 case in the list not all the cases) not to the original "List of Cases".please note thst url is not changing when applying the case filters in "List of Cases" page.
Thanks for your help in advance.
PavanKPavanK
Hi,
when you are click on case, you should pass parameters in URL. And when you clicking back maintain same variable, so when you will be landing on filter page you can get parameters.

Other option is create filter valraible in controller and maintain data as per logic. So when you click on back and previously filter were added then these field will have value and you can reuse these.

Please let me know, if any more information is required or please mark as best answer if my answer helped anyway.

Thanks,
Pavan
Hargobind_SinghHargobind_Singh
In your list page, use $CurrentPage.URL, and add this value to your case link. When you are on your case detail page, you can read this value and use it in your commandLink to go back to search page. 

E.g.: 

<a href="/showCase?caseId={!caseId}&retUrl={!$CurrentPage.URL}">{!caseNumber}</a>

Or you can also try passing retURL to normal Case record URL and Cancel should take you back to the retURL page. 
 
DeveloperSudDeveloperSud
Hello Freinds,
Thanks for your valuable suggestion but situation is little different here. We can't redirect to different window means when click on any specific case on "List of cases" it should open the casedetail page in same window.It will be helpful if you could give us the code also while answering to this. Thanks !!!