Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 8 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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