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
vishalavishala 

Refreshing the URL to correct pagereference URL of the redirected page

Hi All,

 

I have created 2 VF pages and a controller which is the same for both the pages.

From the second VF page I am redirecting it to standard page of the object, when the user clicks on button go.

Page is getting redirected but the URL is being the same of the previous VF page,( from which it has been redirected)  because of which my Submit for Approval is not functioning.

Is there anyway to change the URL of the standard page gets refereshed correctly when the page loads.

In code:

return (new PageReference('/'+id));

After the pageredirects to the standard page the URL on the address bar is:

https://c.visual.force.com/apex/helloworld?param1=a3kv0000000000E

 

Please let me know if in anyway the URL can point to the correct page.

 

Thanks,

vishala.

 

Alok_NagarroAlok_Nagarro

Hi,

 

I think this is because of state. bydefault salesforce hold the state for VF page.Try the code given below-

 

PageReference pr=new PageReference('/'+id);

pr.setRedirect(true);

return pr;

 

hope it would help u.

vishalavishala

I tried with the code which you mentioned, the URL is still the same as with the old code. It hasn't worked.