Getting Record IDs
- Define a button with the following attributes.Display Type─List ButtonNote Select Display Checkboxes (for Multi-Record Selection) so users can select multiple records in the list before clicking the button.Behavior─Execute JavaScriptContent Source─OnClick JavaScriptUse the following sample code.idArray = {!GETRECORDIDS($ObjectType.Contact)};alert("The Ids you have selected are: "+idArray);Note This example is for contacts. Change the object type for a different type of record.
- Display Type─List ButtonNote Select Display Checkboxes (for Multi-Record Selection) so users can select multiple records in the list before clicking the button.
- Behavior─Execute JavaScript
- Content Source─OnClick JavaScript
- Use the following sample code.idArray = {!GETRECORDIDS($ObjectType.Contact)};alert("The Ids you have selected are: "+idArray);Note This example is for contacts. Change the object type for a different type of record.
- Add the button to the appropriate related list on a page layout or list view layout.