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

OPen Visualforce Page on a different Tab, when redirected thru Apex

I am using PageReference.setRedirect(true) to open up a Visualforce page from one VF page. Is there a way to open this on a different tab.



Thanks for any help





If you need to open the VF page on a new tab (or new window) it's best to it via HTML elements rather than the Controller code.



<a href="/apex/myvisualforcepage" target="_blank">Next Step</a>


If you need a button to do that you can utilize javascript.




Edwin VijayEdwin Vijay

You can also use the same "target" attribute on "commandlink".


If you want a button,then use commandlink and inside the commandlink you can have a commandbutton with no action.. Not sure if it would work across browsers but worth giving a try..