When I select multiple clients on this list and click the Email Contacts button on this search page I want to open a visual force page with a special email form on it. How do I get the ids of all of the Contacts that I selected on this page onto the new page?
The Add to Campaign button clearly redirects to a page and has a list of all of the contacts that I have selected so that I can add them to a campaign. I just want to know if I can mimic this ability in my own pages.
If I were doing execute javascript, then I could use the {! GETRECORDIDS (…) } function, but this doesn't seem to work on APEX pages. Only in the on click execute javascript.
=== EDIT ===
Sorry, this above part was not clear… what I'm saying is that I know I can use {! GETRECORDIDS (…)} to get the records that I selected, but what I want to do is load a visual force page with the open in existing window functionality. Then I want to get the data and access it on that apex/visualforce page.
Best Answer
You can add a "List Button" set to "Execute JavaScript" with this JavaScript:
Your Apex page (MyPage here) then just has to split the "ids" parameter to get the set of selected ids.
The limit of 100 selected items is imposed because 2k characters is generally considered the longest URL that works safely everywhere.
PS
To address the comment that more than 100 selected objects may need to be supported, here is how to use a POST instead of a GET:
A bit more detail in How to pass a large number of selections from a standard list view to a Visualforce page.