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
Sravan Kumar 121Sravan Kumar 121 

lost parameters in URL after clicking on button on VF page

I have two VF pages. On click of output link in first VF page it will redirect to second VF page by passing two parameters in URL. The example URL of second page is "https:/**************.visual.force.com/apexXXXXXPageNameXXXX?optId=XXXXXX&accId=XXXXXXX". Now i have some custom validations for the fields on second page on click of custom save button on second page it will show error messages by out put text. now here the URL of page is changed to "https:/**************.visual.force.com/apexXXXXXPageNameXXXX".

The problem is after losing the params in URL if i refresh the page it is throwing null exceptions (i can handle them) but if click on cancel button on second page (it should navigate to first page along with parameter) it is going to first page without any params in URL and the first page is showing empty tables because of the absence of param in URL.

My big question is why the parameters are lost from URL after clicking button on VF page. I know that the parameters are still stored in view state even they are hidden from URL. But i dont want to change the URL after clicking on button.

 
Lokeswara ReddyLokeswara Reddy
Hi Sravan,

Guess you have override Cancel button on second VF page to pass the parameters. As you mentioned when you refresh the page you do get Null pointer exception, can you debug your code that the values are still availble before you click Cancel button?