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

How to pass variable value into an apex class
Hello,
I have a visualforce page exposed in a force.com site. This site is open to the public and guests should be able to access this page through my clients website, a link there would take them to my site. What I need is to pass an IDcode through that link so that when the visualforce page is shown it will have the code in its controller.
The idea is that the page is access by many of my clients and each has their own code, this is important so that when creating the controller class I will be using this "Idcode" to fetch some of the clients data such as rates and availability.
How can I do this???
Hi arishi0,
You can pass URL parameters into Visualforce pages (whether or not they are on a site) thus:
You can then access that parameter from your page controller with:
Note that, if you have no other security in place, you should make the 'IDcode' values long and difficult to guess, otherwise your clients will be able to see each other's rates by simply iterating through IDcodes 1, 2, 3, 4...
Cheers,
Pat
All Answers
Hi arishi0,
You can pass URL parameters into Visualforce pages (whether or not they are on a site) thus:
You can then access that parameter from your page controller with:
Note that, if you have no other security in place, you should make the 'IDcode' values long and difficult to guess, otherwise your clients will be able to see each other's rates by simply iterating through IDcodes 1, 2, 3, 4...
Cheers,
Pat
Thanks Pat!!! It did work, I had a hunch this is how I would go around doing it and in fact it is that way. GReat advice on creating large IDcodes, will certainly do that.
Thanks again!