+ Start a Discussion
rosscorossco 

Creating a Button that opens another VisualForce Page

Goodday

 

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

Ross

 

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

Refer : http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_pages_pagereference.htm

 

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();
      acctPage.setRedirect(true);
      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.