Ads

Friday, 3 May 2013

How to open another Visualforce page from current Visualforce page in Salesforce?

Visualforce page:

<apex:page controller="sample">
            <apex:commandButton value="Open" action="{!openPage}"/>   
</apex:page>


Apex Class: 

public class sample
{
    public pageReference openPage()
    {
        pageReference pg = new pageReference('/apex/Name_Of_The_Page');
        pg.setRedirect(true);
        return pg;
    }      
}

No comments:

Post a Comment