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

Creating a Button that opens another VisualForce Page



How do I create a button on a Visualforce page (not an object) that opens another Visualforce page. I would also like to pass the id parameter that was passed to this visualforcepage page to the next one.


Many thanks in advance



Best Answer chosen by Admin (Salesforce Developers) 
Chamil MadusankaChamil Madusanka

Refer :


public PageReference save() {
      // Add the account to the database.  
      insert account;
      // Send the user to the detail page for the new account. 
      PageReference acctPage = new ApexPages.StandardController(account).view();
      return acctPage;


If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.