1

Is it possible to have two Visualforce pages that use the same controller? I have a VF page that need to be reorganized. It needs to show a slightly different set of fields and show them in a different order. Both versions may be needed in the future.

Obviously, removing required fields or fields used by other fields would be bad. Any other obvious problems with trying to do this?

Note: I'm in the process of trying this out and will post my results. I'm guessing I'll need two test classes, but I haven't got that far yet.

1 Answer 1

4

You can create so many visualforce pages as you wish with the same controller. The benefit - all pages will share controller resources like variables and so on. For example you can create an sObject on the first page and access it on the second page without having to get it form the database again.

This topic can be useful your you: Can two pages use the same controller and share the data

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .