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
Tom M422Tom M422 

VisualForce Page navigation question . One page to another

I'm relatively new to VisualForce Pages and I'm trying to navigate through a series of pages  necessary to complete a long application. The pages are bult against different custom objects and I'm trying to figure out how to go from one page to another where the second page represents a different object. 

 

Any suggestions ?


Thanks


Tom

Ritesh AswaneyRitesh Aswaney

PageReference pgRef = new PageReference('/apex/NextVisualforcePage?id=' + opp.Id); //opp is an eg - use relevant var

pgRef.setRedirect(true);

return pgRef;

 

If your action method in Controller for the current VF Page returns that, you would be re-directed to the next page when the call returns.

 

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

b-Forceb-Force

use one controller for all VF pages, which will help you form maintaining view state and variables

 

Thanks,

Bala