I have created a custom OAF page and linked the same with 3 standard OAF pages(Lets say Standard-Page1, Standard-Page2, Standard-Page3) in such a way that whenever I click the GO button in any of those standard pages it navigates to my custom page.
As of now when I click the BACK button in the custom page it navigates back to Standard-page1(Because i have given the page1 Path in the pageContext.ForwardImmediately) only even though if I would have opened my custom page from standard-Page2 or 3.
I need to understand what should I do to navigate back to the exact standard page from which the custom page has been opened.
You can create a return link/back button on the custom page which would take you pack to th previous page. Do ensure that the AM is retained when you navigate from standard to custom page. This would help you navigate back to standard page and have the AM retained. Only thing to be careful of is to ensure you have some parameters handled in the Standard Controller so that the rendering layout and query executions are not invoked again.
I can suggest further if you need details.
Thanks for your kind reply. I tried another way because we will not have that Standard AM in the Custom Page. The other way is like, getting the standard page URL into a variable and passing it as a session value and getting that session value into a variable in the Custom Page. Then passing that variable in the place of URL in the following way:
In the Standard Page passing URL variable into a session value: