I am trying to capture the URL of the previous page in a custom VF Page, when someone clicks on my custom tab from any page, especially when they are in Setup or Reports area. Following is what I am trying to do, which is not giving me the desired results. I’ll appreciate if anyone can provide any insights on this.
My goal is to capture the previous page url, execute my logic on my custom VF page, and redirect the user to the same previous page.
I have a Custom Tab ‘Check URL’ that displays the custom VF Page. I want to display the following url in the case of click the tab from setup area:
The code is as follow: