To create a “Generate Documents” button for an object’s list view layout go to Setup -> Object Manager -> Selected Object -> Buttons, Links and Actions -> New Button or Link. Next, populate the fields with the following values:
FIELD NAME | VALUE |
LABEL | Any name, e.g. Generate Documents. This will be the name of the button displayed in the app. |
NAME | Any name used by the API and managed packages, e.g. “Generate_Documents_List”. |
DISPLAY TYPE | Select “List Button”. |
DISPLAY CHECKBOXES (FOR MULTIPLE RECORD SELECTION) | Checked. |
BEHAVIOUR | Select “Display in existing window with sidebar”. |
CONTENT SOURCE | Select “Visualforce Page”. |
CONTENT | Select Visualforce page created specifically for that object. |
Next, add the button to the object’s List View page layout. While still on the Object Manager page of the selected object, go to “List View Button Layout” and edit the List View. Under the section “Available Buttons” select “Generate Documents” and move it to the “Selected Buttons” section. Save Changes. Note that the button will not be available on the “Recently Viewed” list view.