DRTE USER GUIDE

Overview

Welcome to the CodeyLabs DRTE for Salesforce. This comprehensive guide will help you create, configure, and manage dynamic documents with integrated e-signature capabilities directly within your Salesforce environment.

##

##

##

##

##

##

##

Table of Contents

  1. Prerequisites
  2. Administrator Setup
  3. UI Integration and Workflow
  4. End-User Workflow
  5. Additional Features
  6. Troubleshooting

##

##

##

##

##

Prerequisites

Before beginning the installation, ensure that Lightning Web Security is enabled in your Salesforce instance.

To enable Lightning Web Security:

  1. Navigate to SetupSession SettingsLightning Web Security
  2. Enable the setting if not already active

Enable Folders and Enhanced Sharing:

Enhanced sharing must be enabled for proper document management functionality.

Administrator Setup

Step 1: Install the Managed Package

  1. Obtain the DRTE installation URL from your provider
  2. Paste the URL into your browser while logged into Salesforce
  3. On the installation screen:
    • Select “Install for All Users” (recommended)
    • Check the acknowledgement box for installing a non-AppExchange application
    • Click Install

  1. You will receive a confirmation email upon successful completion
  2. Verify installation by checking Installed Packages


Step 2: Configure Permission Sets

Permission sets control user access to DRTE features. Proper configuration ensures security and appropriate access levels.

To assign permission sets:

  1. Navigate to SetupPermission Sets

  1. For Administrators:
    • Locate “Dynamic RichText Editor Admin User”
    • Click Manage AssignmentsAdd Assignments
    • Select all system administrators
    • Click Assign
  2. For Standard Users:
    • Clone the “Dynamic RichText Editor Standard User” permission set
    • Remove administrative permissions not required for standard users
    • Assign the cloned permission set to appropriate users

Important Note: The DRTE namespace is pscdnyrichtext. Use the prefix pscdynrichtext__ when configuring custom objects and fields.


Step 3: Configure Allowed Objects

DRTE requires explicit permission to query Salesforce objects for dynamic content.

To add allowed objects:

  1. Navigate to SetupCustom Metadata Types
  2. Find “DRTE Allowed Object” and click Manage Records

  1. Click New to create a new record
  2. Enter the Object API Name (e.g., Contract for standard objects)

Example for managed package objects:

Note: Without adding an object to this list, DRTE components cannot query that object for dynamic data.


Step 4: Create Document Templates

Document templates define the structure and content of your generated documents.

To create a template:

  1. Open the App Launcher and search for “Rich”
  2. Select “Rich Text Buttons/Doc Templates”

  1. Click New to create a template record

  1. Configure the following fields:
    • Template Name: Enter a descriptive name (e.g., “Contract Template”)
    • Deactivated: Check this box during initial setup
    • SLDS Icon Name: Enter an icon name (e.g., utility:contract_doc)
    • Test SFDC Record ID: Enter an existing record ID for testing

Step 5: Add Document Sections and SOQL Queries

Document sections define the dynamic content and data sources for your templates.

To create a document section:

  1. From your template record, scroll to the related list
  2. Click New Doc Section

  1. Configure section details:
    • Type: Select Table for dynamic content or Paragraph for static content
    • Display Order: Set to 10 (allows for future insertions)
    • HTML Content: Paste your template HTML
    • Iterate HTML for Records: Check this box for dynamic content to show multiple records only. For single record merge context, there’s no need to check this box.

  1. Add SOQL Query:

Enter a SOQL query to retrieve data. Example:

Example sql

SELECT Id, ContractNumber, AccountId, Account.Name,

   Account.BillingState, Status, StartDate, EndDate, 

   SpecialTerms, Description

FROM Contract

WHERE ID = ‘{pv0}’

Important: The {pv0} placeholder automatically captures the current record ID from the page context.

To show Tables in the document, After you define the SOQL query, use the Table Config & Style Builder action (instead manually defining them) to build the table columns and style them.

For applying html styles (not supported directly by the editor of HTML Content field), use Update HTML Content Source action.

For example, you can use page break class to apply page break in the downloaded pdf document automatically.

DRTE supports css classes for applying page break after or before any element in the final rendered server side pdf.

  1. Click Preview Document to validate your configuration


Step 6: Add E-Signature Placeholders

E-signature placeholders define where signers will input information and sign the document.

General Placeholders

Format: [type[label]]

Examples:

Signature-Specific Placeholders

Format: [type[label]:[signature]]

Examples:

Single Signer Example:

Multiple Signers Example:


##

##

##

UI Integration and Workflow

Step 7: Create E-Signature Site

Create a public-facing site where external signers can view and sign documents.

To create the site:

  1. Navigate to SetupDigital ExperiencesAll Sites
  2. Click New Site
  3. Select “Build Your Own (Aura)” template
  4. Name your site (e.g., “DRTE_Sign_Site”)

  1. Open the site in Builder
  2. Change the home page theme to DRTE EsignThemeForExperienceSite with only one content region on the page.
  3. Drag the “Dynamic Rich Text Editor for Guest User” component onto the home page.

  4. In Advance, Edit Head Markup, and add below style tag to remove extra spaces around the DRTE component to give a full page view.


    <style>
    .cCenterPanel{
    padding-left:0px!important;
    padding-right:0px !important;
    margin-top:0px !important;
    }
    </style>

  5. In settings, enable “Guest users can see and interact with the site without logging in”


Step 8: Configure Guest User Permissions

To set guest user permissions:

  1. Access the Guest User Profile from Builder settings

  1. Assign the “DRTE guest user” permission set

  1. Activate the site


Step 9: Configure Sharing Rules

Sharing rules ensure guest users can only access documents intended for them.

To create sharing rules:

  1. Navigate to SetupSharing Settings

  1. Create sharing rules for both:
    • E Signature Log/Signed Document
    • E Signature Request
  2. For each object:
    • Click New
    • Set Rule Type to “Guest User Access”
    • Define criteria (e.g., token not null and status is sent) exactly shown in the screen shot below.


To configure the site URL:

  1. Copy your site URL from All Sites

  1. Navigate to SetupCustom Settings

  1. Click Manage next to “DRTE Settings”
  2. Paste the site URL in the default org-wide value field


Step 11: Add DRTE to Record Pages

Configure the DRTE component on your object record pages (e.g., Contract or any SFDC object).

To add DRTE components:

  1. Open the Lightning App Builder for your record page

  1. Add a new tab named “Contract Document”
  2. Add the following components:
    • Dynamic Rich Text Editor (main area)
    • E-Signature Request List (right panel)

  1. Configure component properties:
    • Default Template SFDC Id: Enter your template record ID
    • Footer: Optional footer text
    • Show Page Number: Enable/disable page numbers
    • Read Only: Restrict manual editing (only keep it unchecked when needed to make it editable on the fly)
    • Enable to request E-Signature: Enable signature functionality
  2. Add the E Signature Workflow component

For the latest upgraded version of E Signature Request List, select Show Advanced Hierarchy View in the component property.


Step 12: Configure Email Templates

To set up PIN email notifications (this is a mandatory step, as the packaged email template is referencing wrong entity type):

  1. Clone the package-included email template
  2. Change Entity Type to “E Signature Request Pin”

  1. Update the Share PIN Email Template Id in DRTE Settings

To enable PIN authentication:

Check the Require PIN field on the E Signature Request record, manually or programmatically as per your organisation requirements. When this is checked, it will always asks end user to verify PIN before watching the document.

End-User Workflow

Step 13: Generate and Review Documents

To generate a document:

  1. Open the relevant record (e.g., Contract)
  2. Click the “Contract Document” tab

  1. Review the automatically generated document
  2. Update the record status as needed (e.g., “In Approval Progress”)


Step 14: Send for E-Signature (First Signer)

To request a signature:

  1. Click the “Request E-Signature” button

  1. Enter the first signer’s information (a Signature placeholder in document is mandatory to be able to generate a E-Signature Request, the DRTE system automatically parses the document to find the unique signature placeholders in the document and generates a list in ‘Select a Placeholder’ picklist.

  1. Verify signature placeholder matches signer details
  2. Refresh the E-Signature Request List to confirm (when it doesn’t automatically refreshed)
  3. Drag and Drop the second signer box in the workflow over first signer to create a link between them.
  4. Click on Begin Workflow, to kick off signature process automatically while on the same screen (or you can always manually start it from first E Signature Request record)


Step 15: Configure Signing Order

To set up sequential signing (Manually):

  1. Create a second e-signature request for the next signer

  1. Open the second request record
  2. In the “Only After Signing” field, select the first request

This ensures the second signer receives notification only after the first signer completes their signature.


Step 16: Send Signature Requests

To trigger the signing process (Manually):

  1. Open the first e-signature request
  2. Change Status to “Sent for Signature”
  3. The first signer receives an email notification and starts singing from there.

  1. Monitor status updates in the E-Signature Request List

  1. Repeat for subsequent signers (manually)


Step 17: Mobile Signing Experience

Mobile signing workflow:

Step 1: Signer opens the email on mobile device

Step 2: Signer reviews the document

Step 3: Signer fills in details and signs

Step 4: Signature is applied with timestamp


Step 18: Finalize and Store Documents

To complete the process:

  1. After all signatures are collected, open the E-Signature Log record

  1. Verify all signature details:
    • Date and time
    • IP address
    • Full name

  1. Click the button to upload the signed document to Files

Important: Always use Server Side Upload Source


Step 19: Share and Activate

To finalize the contract:

  1. Share the signed document with all parties

  1. Next steps, for example, update the contract status to “Activated” (manually)

##

##

Additional Features

1. Automatic Sequential Signing

Configure automatic sending to the next signer upon completion, define this on the first signer E Signature Request record:

2. Enhanced Security with PIN

Add PIN-based authentication for additional security:

3. Document View Tracking

Track when signers view the document:

4. Custom File Names

Apply custom file names to signed documents:


##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

Troubleshooting

Images Not Displaying in Guest Portal

Issue: Document images are not visible in the e-signature guest user portal.

Solution: Add a trusted URL entry for https://[domain].lightning.force.com where [domain] is your Salesforce org’s My Domain.


Document Section Not Displaying

Issue: Document section is not displaying despite correct SOQL query.

Solution: Verify that the object API name is listed in DRTE Allowed Objects records. Only objects in this list can be queried.


IP Address Tracking

Question: We do not want to track/store signer IP Address ? Can we stop that ?

Answer: Yes. You can stop tracking and storing external signer IP addresses.


Custom Email Templates

Question: Can I use my own branded email templates?

Answer: Yes. Clone the existing packaged email templates or create new ones. Update the template IDs in DRTE Settings custom settings to reflect your new templates.


Button-Triggered Document Generation

Question: Can I generate documents via button click instead of a tab?

Answer: Yes. The DRTE managed package exposes several flow actions:

  1. Build Document and Return Preview Id
    • Apex: pscdnyrichtext__DocumentGeneratorService
    • Uses Document Template Id and Related Record Id (‘pv0’)
    • Builds document on server and updates preview record
  2. Generate Document Directly on Server
    • Apex: pscdnyrichtext__GenerateDocumentAction
    • Generates PDF and saves to Files without editor
  3. Upload Signed Document from E-Signature Log
    • Apex: pscdnyrichtext__UploadSignedDocument
    • Generates PDF and saves to Files on related E-Signature Log record

Question: I was supposed to create 2 E Signature requests on a document but accidentally/overlooked to create just Signature1 and begin the workflow. Apparently the first signer has also signed the document. Add Signature2 later from the DRTE editor is not bringing already signed content in the request document. What to do ?

Solution: Don’t worry. DRTE has an answer to this problem.

Simply navigate to the E Signature Log/Singed Document record created under Signature1 E Signature Request record. Notice that the Signee 1 has signed.

Also validate, the placeholders for Signee 2 (Signature 2) exists on the response document.

After all validations are complete, simply ‘Request Next Signer’ and associate Signature 2 - contact and placeholder to add a new signature request for the document.

Create a link on a newly created signature 2 request record with the Signature 1 request record through Only After Signing field.

And hit the Send Signature Request Button. Done. You have signature request to your second signee with the document including the signature from 1st Signee

Notice the correct linking now on the document record page.


Question: For Invoices or any other financial transactional objects, can we use a custom company header template on the generated PDF within DRTE (Dynamic Rich Text Engine)?

Solution:

Yes, this can be achieved using a custom image file as the header.

To implement this, follow these three steps:

  1. Prepare the Image: Create your header image with the specific dimensions of 1340 px (width) x 200 px (height), preferred.
  2. Generate Public Link: Upload this image to Salesforce Files and generate a non-expirable public link (URL) for the file.
  3. Configure DRTE: Copy the image URL and paste it into the ‘Header Image URL (PDF only)’ property within your DRTE template configuration.

##

Support

For additional assistance or questions not covered in this guide, please contact your Salesforce administrator or DRTE support team at support@codeylabs.com.


*DRTE Version v5.128 Last Updated: November 2025*