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
Roger PavelleRoger Pavelle 

How do you use retURL on the called page?

Hi,

I have two pages (call them page 1 and page 2).  Page 1 has several checkboxes that help determine search criterial.  You then select a item and click a button to go to page 2.  When I return from page 2 to page 1, I want the search criteria to still be checked.

I understand that I need to set the retURL parameter on page 1 before I call/open page 2.  What I'm not clear on is how page 2 then uses that parameter.

The code I currently have (no retURL coded yet) is as follows:
page 1:
                        <apex:outputLink value="/apex/boleteDetailView?id={!bol.Id}" id="viewLink">
                            View
                        </apex:outputLink>
page 2:
        <apex:commandButton action="/apex/BoleteSearch" id="returnButtonBottom" value="Return to Search" />

Thanks.
Best Answer chosen by Roger Pavelle
William TranWilliam Tran
Unless page 2 explicitly redirect to another page, it will use retURL to go back to page 1 (by default on cancel, save, etc.)
By specifying the retURL you specify where to go next after page 2.  

If you want page 2 to send information back to page 1 you can pass it in the URL like ....?retURL=/apex/page1&checkbox1=checked&checkbox2=unchecked

Note: you can pass the info from page1 to page 2 so page 2 and pass back to page 1

Thx

All Answers

William TranWilliam Tran
Unless page 2 explicitly redirect to another page, it will use retURL to go back to page 1 (by default on cancel, save, etc.)
By specifying the retURL you specify where to go next after page 2.  

If you want page 2 to send information back to page 1 you can pass it in the URL like ....?retURL=/apex/page1&checkbox1=checked&checkbox2=unchecked

Note: you can pass the info from page1 to page 2 so page 2 and pass back to page 1

Thx
This was selected as the best answer
Roger PavelleRoger Pavelle
Thanks.  None of the documentation I could find says that.