Dev: Signatory Log Integration

1. Overview

The uploadAndGetFileIdOFSignedDocument (Upload Signed Document from E-Signature Log Record) method is a global Invocable Action provided by the DRTE package. It is designed to be called within a Salesforce Flow after a signing process is completed.

The method performs the following server-side operations:

  1. PDF Generation: Renders the finalized document (including signatures) using the internal DRTE PDF engine.
  2. File Creation: Generates a standard Salesforce ContentVersion (File).
  3. Automatic Linking: Attaches the generated File to the specified E-Signature Log record.
  4. ID Return: Returns the unique ID of the new File for use in subsequent Flow steps (e.g., sending an email with the attachment).


2. Input Parameters

When configuring the "Apex Action" in Flow, the following input variables are available:

Parameter

API Name

Data Type

Required

Description

Record ID

recordId

Text

Yes

The Salesforce ID of the E-Signature Log record.

Envelope Token

token

Text

Yes

The unique security token/Envelope ID associated with the signing request.

File Name

fileName

Text

No

The desired name for the PDF file (omit ".pdf"). Defaults to the Token value if left blank.

Footer Text

footerText

Text

No

Custom text to appear in the footer of the generated PDF.

Header Image URL

headerImageURL

Text

No

A public URL for a logo to be rendered in the PDF header.



3. Output Values

Parameter

Data Type

Description

Output Value

Text (String)

The ID of the generated ContentVersion record (The File ID).



4. How to Use in Salesforce Flow

Step 1: Trigger the Flow

Typically, this action is used in a Record-Triggered Flow on the pscdnyrichtext__ESignature_Log__c object when the Status changes to "Completed" or "Signed."

Step 2: Add the Apex Action

  1. In the Flow Builder, add a new Action element.
  2. Search for "Upload Signed Document from E-Signature Log Record".
  3. Map your variables:

Step 3: Utilize the Output

Since the action returns the File ID, you can add a subsequent step to:


5. Technical Considerations & Security

Atomic Operation: The file insertion and the link to the recordId happen in a single transaction. If the file creation fails, the transaction rolls back to maintain data integrity.

Redirecting you to the article... Click here if you are not redirected automatically.