Skip to main content

How to Automatically Generate Documents in Salesforce

Updated over a month ago

Overview

  • docuWeaver provides several Apex actions to automate various document processes. For automatically generating documents, docuWeaver includes an Apex action called “Generate Document.”

  • The Generate Document Apex action creates documents from specified templates and automatically attaches them to Salesforce records.

  • It supports attachment to related records like Accounts or Cases for better organization.

  • This guide details Flow configuration for seamless automation.

Pre-requisites

  1. Required document templates must be created in advance.

  2. Ensure the running user has access to the Apex Action through the appropriate profile or permission set.

Flow Configuration Steps

  1. Open Flow Builder and add an Action element after your desired step (e.g., trigger or screen).

  2. Search for and select your Apex action method (e.g., "Generate Document").

  3. Map Flow variables or static values to input parameters (for example, provide the template name, assign the record Id, specify the base path, and define the action name).

  4. Under Advanced > "Manually assign variables", store outputs in a Flow variable (e.g., collection for List<Result>).

  5. Connect to next elements and activate/debug the Flow.​​

Test in a Screen Flow or Record-Triggered Flow; ensure the running user has Apex action access via profile/permission set.​

Refer to the Apex Action Documentation for detailed input parameters, including Template Name, Record ID, and optional settings.

Did this answer your question?