Loading
Salesforce Document Generation
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Add the Generate Document Component to a Record Page

          Add the Generate Document Component to a Record Page

          Add the Generate Document Lightning Web Component to a Lightning record page to generate documents directly from the record.

          Required Editions

          Available in: Lightning Experience
          Available in: Professional, Enterprise, Unlimited, and Developer Editions
          User Permissions Needed
          To add the Generate Document LWC:

          DocGen Runtime

          OR

          DocGen Designer

          Before you begin:

          • Configure document templates and data mappings.
          • Make sure that the document generation feature is enabled in your org.
          • Verify that you have access to the required objects and templates.

          For illustration purpose, we use Contract object.

          1. From Setup, go to Object Manager and select the Contract object.
          2. Open Lightning Record Pages.
          3. Select an existing record page.
            You can also create a page.
          4. Click Edit.
          5. In Lightning App Builder, locate Generate Document in the components list.
          6. Drag the Generate Document component onto the page.
          7. Configure required component properties.
            Specify values such as Service Function, Context ID, Document Template ID, and Document Title. Component behavior depends on the configured properties.
          8. Merge additional PDFs with the generated document.
            1. Select Merge PDF as the Service Function.
            2. Enter a comma-separated list of PDF file IDs in the PDF Document Identifiers List.
              The order of IDs determines the final document sequence.
          9. Select Show Generate Button, and enter a label for the button.
          10. Save and activate the page.
            You can generate and attach documents directly from the record page.
           
          Loading
          Salesforce Help | Article