Bulk Document Generation
Mass Merge / Bulk Document Generation
- Configuration Steps
- End-User Workflow
- Troubleshooting and Support
Understanding the Bulk Generation URL
The custom button uses a specific URL structure to invoke the bulk generation flow. The parameters in the URL define which template to use and how to name the output files.
URL Parameter Key | Description | Example Value |
SFDCDocumentTemplateId | The 18-digit SFDC Record ID of the DRTE Document Template to be used for generation. | a01XXXXXXXXXXXXXXX |
SFDCObjectAPIName | The API Name of the Salesforce Object (e.g., standard or custom) where the button is placed. | Invoice__c or Account |
SFDCDocumentFileNamePrefix | A 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.
Step 1: Create the Custom List View Button
- Navigate to Setup -> Object Manager.
- Search for and select the Target Object (e.g., a custom Invoice__c object) on which you want to enable bulk generation.
- Go to Buttons, Links, and Actions and click New Button or Link.
- Configure the button details:
- Label: Provide a user-friendly label (e.g., Generate Documents or Bulk Invoice Generation).
- Name: Enter the API name (e.g., Generate_Documents).
- Display Type: Select List Button.
- Ensure "Display Checkboxes (for Multi-Record Selection)" is checked.
- Content Source: Select URL.
- Content: Paste the generic URL structure and replace the bracketed values with your specific configuration details (e.g., inserting your template ID).
Document Template id is the SFDC record id of your rich text button/document template related to the object you selected, in this example we are using document template id of ‘Invoice Document’ doc template.
Step 2: Add the Button to the List View Layout
- While still in the Object Manager for the Target Object, navigate to List View Button Layout.
- Click Edit next to the List View layout you wish to modify.
- Move the newly created custom button (e.g., Generate Documents) from the Available Buttons list to the Selected Buttons list.
- Click Save.
The Mass Merge feature is now configured and ready for end-user deployment.
End-User Workflow - Mass Merge / Bulk Document Generation
The bulk generation process is initiated by the end-user directly from a standard or custom List View.
- Prepare the List View: The user navigates to the List View of the target object (e.g., Invoices). They should apply appropriate filters to ensure the view displays only the records for which documents need to be generated.
- Select Records: The user selects the checkboxes next to the desired records.
- Initiate Merge: The user clicks the custom button (e.g., "Generate Documents" or "Bulk Invoice Generation") located above the list view.
- Confirm and Proceed: A confirmation screen will appear, showing the number of selected records and prompting the user to confirm the action. The user clicks Proceed.
Monitor Processing: The user is immediately redirected to a Batch Record screen. This record serves as the central log for the background process.
- The batch status will typically update quickly (e.g., from Queued to Processing).
- The screen will show the status of individual records as the Document Content is built and PDF generation is initiated.
- Completion: Once the batch status shows Completed, the documents have been generated.
Access Documents: All generated PDF documents are automatically saved to the Files related list of their respective records (e.g., the generated Invoice PDF will be saved to the related Invoice record).