You need to sign in to do that
Don't have an account?

Passing a variable between VF pages
I need to pass a common variable, let's call it "client name", from a custom object through a number of pages that access different tables. Does anyone know how to code that in either the VF page or the extension?
Thanks in advance
Tom
If pages uses the same controller then IT is common at runtime as long as you switch between the pages with VF actions that return the next page. If you go directly to the url for another page, or use a page reference with redirect=true, then you will get a new instance of the controller so any variables will be lost.
But you can most definitely share data via controller variables if you do it right.
All Answers
You need to look at PageReference. Call a function like the one given bellow from your command button.
Or if you just used a common controller for all of these pages, then you wouldn't have to pass parameters. it could just be an instance variable, which is set on the controller.
Common controller is not common at run time. A new instance is created for each page. If you really wan to use common controller use merge fields to save the data in an Object (table) and use the value from the object. Then you are not really passing parameters yet achieving the same result.
If pages uses the same controller then IT is common at runtime as long as you switch between the pages with VF actions that return the next page. If you go directly to the url for another page, or use a page reference with redirect=true, then you will get a new instance of the controller so any variables will be lost.
But you can most definitely share data via controller variables if you do it right.
Thanks All,