Create Document Templates

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:


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: (Additional Video: https://www.youtube.com/watch?v=XYsknOjVqHQ)

  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


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