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
Payel GhoshPayel Ghosh 

Not able to redirect to a standard controller VF page

I have written a standard controller VF page. Now from anoth is er VF page I want to redirect to the standard controller VF page. I am trying to do it through pagereference. But it's not getting redirected. But if I remove the standard controller from the destination, then it's getting redirected to that page.

My standard controller page is getting displayed perfectly when I am displaying it from a custom button. Only when from another vf page I want yo redirect to this standard controller page, that's not happening.

Below is the standard controller VF page.  Name of the Page is SaveMessagePage. -Standard controller

Below is extension controller of another VF page from where I want to redirect to the above page -

PageReference p = new PageReference('/apex/SaveMessagePage');
Return p;

 Please help.
ANUTEJANUTEJ (Salesforce Developers) 
Hi Payal,

You can try checking the below link I think this could help in your use case:

>> http://writeforce.blogspot.com/2014/08/demystifying-pagereference.html

In case if this comes in handy can you please choose this as the best answer so that it can be used by others in the future.

Regards,
Anutej
Payel GhoshPayel Ghosh
Hi Anutej,

Thank you. The issue is solved now. After giving setredirect(true), I was not hard refreshing the page, so the change was not reflecting and I removed that line. But now it's working :)