+ Start a Discussion
kantravikantkantravikant 

Call visualforce page through a visualforce page

How to achieve this requirement?

Select the value from picklist and related other picklist and click on button on a vf page then a specific vf page should display.

Best Answer chosen by Admin (Salesforce Developers) 
Anoop AsokAnoop Asok

Hi Ravi,

You can invoke an action method in your controller on the button click.

In the method, you can put the logic to identify the page to be opened based on your picklist values, and then return a page reference object for the required vf page.

 

PageReference pageRef = new PageReference('/apex/<your vf name>');

return pageRef;

 

For more information, you can look up on the PageReference Class in Apex Code Developer's Guide.

 

Thanks,
Anoop Asok

 

All Answers

Anoop AsokAnoop Asok

Hi Ravi,

You can invoke an action method in your controller on the button click.

In the method, you can put the logic to identify the page to be opened based on your picklist values, and then return a page reference object for the required vf page.

 

PageReference pageRef = new PageReference('/apex/<your vf name>');

return pageRef;

 

For more information, you can look up on the PageReference Class in Apex Code Developer's Guide.

 

Thanks,
Anoop Asok

 

This was selected as the best answer
kantravikantkantravikant

Thanks Anoop