You need to sign in to do that
Don't have an account?
Romeo Mirzac
Redirecting back to Original page
Sorry for this simplistic question, but I have a custom button on 2 different pages which calls the same Visualforce page. How can I redirect the user back to the correct page when they hit "back" on my custom page?
NOTE: One of the pages with the button that calls the VF page is the standard list page...
Thanks
NOTE: One of the pages with the button that calls the VF page is the standard list page...
Thanks
1. On click of buttons - pass current page URL (window.location) as a parameter to VF page.
For example on click of button 1, URL would be - https://ap1.salesforce.com/apex/somePage?retUrl=/001xxxxx...
And on click of button 2, URL would be - https://ap1.salesforce.com/apex/somePage?retUrl=/003xxxxx...
2. In your VF controller, get this retUrl parameter and bind it with your back button.
A more generic approach would be to use document referrer or document history in Javascript.
All Answers
http://www.developerforce.com/guides/Visualforce_in_Practice.pdf
1. On click of buttons - pass current page URL (window.location) as a parameter to VF page.
For example on click of button 1, URL would be - https://ap1.salesforce.com/apex/somePage?retUrl=/001xxxxx...
And on click of button 2, URL would be - https://ap1.salesforce.com/apex/somePage?retUrl=/003xxxxx...
2. In your VF controller, get this retUrl parameter and bind it with your back button.
A more generic approach would be to use document referrer or document history in Javascript.