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.
##
##
##
##
##
##
##
##
##
##
##
##
Before beginning the installation, ensure that Lightning Web Security is enabled in your Salesforce instance.
To enable Lightning Web Security:
Enable Folders and Enhanced Sharing:
Enhanced sharing must be enabled for proper document management functionality.
Permission sets control user access to DRTE features. Proper configuration ensures security and appropriate access levels.
To assign permission sets:
Important Note: The DRTE namespace is pscdnyrichtext. Use the prefix pscdynrichtext__ when configuring custom objects and fields.
DRTE requires explicit permission to query Salesforce objects for dynamic content.
To add allowed objects:
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.
Document templates define the structure and content of your generated documents.
To create a template:
utility:contract_doc)Document sections define the dynamic content and data sources for your templates.
To create a document section:
Table for dynamic content or Paragraph for static content10 (allows for future insertions)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.
E-signature placeholders define where signers will input information and sign the document.
Format: [type[label]]
Examples:
[text[First Name]] - Text input field[date[Service Date]] - Date fieldFormat: [type[label]:[signature]]
Examples:
[text[First Name]:[Signature1]] - Assigned to first signer[Signature1] - Signature field for clientSingle Signer Example:
Multiple Signers Example:
##
##
##
Create a public-facing site where external signers can view and sign documents.
To create the site:
Drag the “Dynamic Rich Text Editor for Guest User” component onto the home page.
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>
To set guest user permissions:
Sharing rules ensure guest users can only access documents intended for them.
To create sharing rules:
To configure the site URL:
Configure the DRTE component on your object record pages (e.g., Contract or any SFDC object).
To add DRTE components:
For the latest upgraded version of E Signature Request List, select Show Advanced Hierarchy View in the component property.
To set up PIN email notifications (this is a mandatory step, as the packaged email template is referencing wrong entity type):
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.
To generate a document:
To request a signature:
To set up sequential signing (Manually):
This ensures the second signer receives notification only after the first signer completes their signature.
To trigger the signing process (Manually):
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
To complete the process:
Important: Always use Server Side Upload Source
To finalize the contract:
##
##
Configure automatic sending to the next signer upon completion, define this on the first signer E Signature Request record:
Add PIN-based authentication for additional security:
Track when signers view the document:
Apply custom file names to signed documents:
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
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.
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.
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.
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.
Question: Can I generate documents via button click instead of a tab?
Answer: Yes. The DRTE managed package exposes several flow actions:
pscdnyrichtext__DocumentGeneratorServicepscdnyrichtext__GenerateDocumentActionpscdnyrichtext__UploadSignedDocumentQuestion: 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:
##
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* |