Bulk Document Generation

Published on February 10, 2026 DRTE



Mass Merge / Bulk Document Generation

Mass Merge lets users generate documents for multiple selected records at once from a Salesforce List View. Document creation is queued as a background process, saving significant time compared with generating documents one record at a time.

In this guide:
1. Understanding the Bulk Generation URL
2. Configuration Steps (create the button, add it to the layout)
3. End-User Workflow
4. Troubleshooting and Support

Understanding the Bulk Generation URL

The custom button uses a specific URL structure to invoke the bulk generation flow. The parameters define which template to use and how to name the output files.

URL Parameter KeyDescriptionExample Value
SFDCDocumentTemplateIdThe 18-digit SFDC Record ID of the DRTE Document Template to be used for generation.a01XXXXXXXXXXXXXXX
SFDCObjectAPINameThe API Name of the Salesforce Object (standard or custom) where the button is placed.Invoice__c or Account
SFDCDocumentFileNamePrefixA prefix used to name the generated document files.Bulk_Invoice_

Generic URL Structure

/flow/drte_ext/GenerateMassDocument?SFDCDocumentTemplateId=[DocumentTemplateId]&SFDCObjectAPIName=[SFDCOBJectAPiName]&SFDCDocumentFileNamePrefix=[NameOfFileToSave]
Important Note: The URL key names (e.g., SFDCDocumentTemplateId) must be used exactly as shown for the feature to function correctly.

Configuration Steps

Step 1: Create the Custom List View Button

  1. Navigate to Setup -> Object Manager.
  2. Search for and select the Target Object (e.g., a custom Invoice__c object) on which you want to enable bulk generation.

Select the target object in Object Manager
Figure 1: Select the target object in Object Manager.

  1. Go to Buttons, Links, and Actions and click New Button or Link.

New Button or Link
Figure 2: Buttons, Links, and Actions - New Button or Link.

  1. Configure the button details:
  2. Label: Provide a user-friendly label (e.g., Generate Documents or Bulk Invoice Generation).
  3. Name: Enter the API name (e.g., Generate_Documents).
  4. Display Type: Select List Button.
  5. Ensure "Display Checkboxes (for Multi-Record Selection)" is checked.
  6. Content Source: Select URL.
  7. Content: Paste the generic URL structure and replace the bracketed values with your specific configuration details (e.g., inserting your template ID).

Button configuration
Figure 3: List button configuration.

Tip: The Document Template Id is the SFDC record Id of your rich text button/document template related to the selected object. In this example, we are using the Document Template Id of the 'Invoice Document' template.

Document template record Id
Figure 4: Locating the Document Template record Id.

Step 2: Add the Button to the List View Layout

  1. While still in the Object Manager for the Target Object, navigate to List View Button Layout.

List View Button Layout
Figure 5: List View Button Layout.

  1. Click Edit next to the List View layout you wish to modify.
  2. Move the newly created custom button (e.g., Generate Documents) from Available Buttons to Selected Buttons.

Move button to Selected Buttons
Figure 6: Move the button to Selected Buttons.

  1. Click Save.
Success: The Mass Merge feature is now configured and ready for end-user deployment.

Configuration complete
Figure 7: Button available on the list view.End-User Workflow

The bulk generation process is initiated by the end user directly from a standard or custom List View.

  1. Prepare the List View: Navigate to the List View of the target object (e.g., Invoices). Apply filters so the view displays only the records for which documents need to be generated.
  2. Select Records: Select the checkboxes next to the desired records.

Select records
Figure 8: Select records in the list view.

  1. Initiate Merge: Click the custom button (e.g., "Generate Documents" or "Bulk Invoice Generation") located above the list view.

Click the custom button
Figure 9: Click the bulk generation button.

  1. Confirm and Proceed: A confirmation screen shows the number of selected records. Click Proceed.

Confirmation screen
Figure 10: Confirmation screen.

  1. Monitor Processing: You are immediately redirected to a Batch Record screen, which serves as the central log for the background process.

Batch record
Figure 11: Batch Record screen.

  1. The batch status typically updates quickly (e.g., from Queued to Processing).
  2. The screen shows the status of individual records as the Document Content is built and PDF generation is initiated.

Processing status
Figure 12: Batch processing status.
Record-level status
Figure 13: Record-level status.

  1. Completion: Once the batch status shows Completed, the documents have been generated.

Batch completed
Figure 14: Completed batch.

Access Documents: All generated PDF documents are automatically saved to the Files related list of their respective records (e.g., the generated Invoice PDF is saved to the related Invoice record).

Troubleshooting and Support

Button does nothing or shows an error?
- Confirm the URL key names match exactly (SFDCDocumentTemplateId, SFDCObjectAPIName, SFDCDocumentFileNamePrefix).
- Verify the template Id is the correct 18-digit record Id.
- Verify the object API name matches the object where the button is placed.
- Confirm the button is in the Selected Buttons list of the List View Button Layout.
Need help? If the issue persists, contact support with the Batch Record details and the button URL you configured.

Knowledge Article Number: KA-00112

View more articles in the knowledge base