Tuesday, March 30, 2010

Salesforce - Using a Custom Link Button to pass Multi-Record Selection Id's to an external URL

My objective is to allow the user to select Leads from a view using the check-boxes and then pass the Id's of these leads to a third party site.

The GETRECORDIDS(object_type) function is the key part but I can't get it to work in a URL. See GetRecordIds() with a custom button

So far the best solution I've found is to use Javascript (where GETRECORDIDS does work) with the custom link button to pass the Id's to a Visualforce page that uses a Custom Controller. The custom control reads the id's from the query string and then passes them on to an iframe in the visual force page.

See also: List Buttons with VisualForce