I wish to create hyperlinks to a specific visual force page which displays a list of opportunities. The data in the page will need to be different. In some cases it will be all open opportunities above a certain value and in other cases it might be all opportunities not updated in last 6 months.

So, I am writing my own extension controller. I need to pass query parameters along the HTTP request to the extension controller so the extension controller knows what Opportunities to get for the page.

Is it possible to do this?

1 Answer 1


Yes, you can do this with the getParameters method on the PageReference class. See this link for more details on that:


For example, assuming you had the following URL parameters:


In your code you can retrieve them like this:

String a = ApexPages.currentPage().getParameters().get('a');
String b = ApexPages.currentPage().getParameters().get('b');
String c = ApexPages.currentPage().getParameters().get('c');

Note, ApexPages.currentPage() returns a PageReference object.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.