DRTE Sections Editor

Administrator (Setup and Sections Editor) Documentation


Objective: Enable the Template Sections Editor workspace on the Rich Text Button/Document Template Object Record Page and How to define dynamic template with sections.


Watch a comprehensive user demo (how to use)


https://www.youtube.com/watch?v=AohE41QYNjU



1. Environment Setup

To provide the Template Editor with their workspace, you must configure the Lightning Record Page:

  1. Access App Builder: Go to the Rich Text Button/Document Template object and edit the Record Page.
  2. Tab Creation: Add a new tab to the layout. Label it "Document Sections Editor" to maintain standard naming conventions.
  3. Component Deployment: Locate the pscdSectionEditor under the "Custom - Managed" components section. Drag and drop it into the newly created tab.


2. Component Activation

  1. Visibility: If the editor should only be visible for certain template types, use Component Visibility filters
  2. Save & Desktop Assignment: Save the changes and ensure the page is activated as the Org Default or assigned to the specific App used by your design team.





IMPORTANT:

The Category field on the Template record has been repurposed to store the Object API Name of the Master/Base object. This field is strictly reserved for the API Name and must follow standard Salesforce naming conventions:

  1. Standard Objects: Use the API name (e.g., Account).
  2. Custom Objects: Must include the __c suffix (e.g., Service_Ticket__c).
  3. Managed Package Objects: Must include the namespace prefix and suffix (e.g., NS__Custom_Object__c).



Template Editor Documentation

Role: Document Designer & Logic Architect

Objective: Transform static Word documents/Manual Sections into dynamic, data-driven Salesforce templates.



1. Document Ingestion

Start by converting your existing business assets into the system:

  1. Upload: Use the Upload DOCX button to bring in a Microsoft Word file. The engine will split the document into editable RichText sections.
  2. Commit: You must click the blue Save button in the header after uploading/making any changes to finalize the creation of these sections in Salesforce.

2. Data Architecting (The Query Builder)

This step defines what data is "available" to be merged into your document:

  1. Initialize: Click the Settings icon on a specific section and select Build Query.
  2. Object Mapping: Search for and select the Salesforce Object you are reporting on (e.g., Opportunity or Order).
  3. Field Selection: Choose all fields needed for this specific section.
  4. The {pv0} Constraint: To ensure the document pulls data from the record you are currently viewing, you must add a WHERE condition: Id equals {pv0}.
  5. Save Logic: Click Save in the modal to inject the SOQL code into the section's configuration.



3. Content Design & Mapping

Now, link the data to your text layout:

  1. Insert Placeholders: In the Rich Text Editor, place your cursor where the data should appear. Use the Insert Field... dropdown to select the fields you chose in the Query Builder.
  2. Styling: Use the toolbar to apply branding, font styles (Sans Serif is default), and paragraph alignment.
  3. Advanced HTML: If you need specific formatting (like custom CSS or table widths), click <Edit HTML> to modify the raw source code.

4. Validation & Quality Control

  1. Preview: Use the Preview Document button at the top of the page (make sure you have defined the Test SFDC Record Id in details tab). This is your "Sandbox" mode to verify that {{Field_Names}} are replaced by actual data values.
  2. Logic Check: Verify that dates, currency, and lookup names (e.g., Account.Name) are rendering correctly.
  3. Version Control: Use the Export Sections feature to download a JSON backup of your work before making major structural changes.
Design Tip: If you need to pull data from a related parent object (e.g., the Account Name from an Order), ensure you select the Relationship Fields tab within the SOQL Query Builder during Step 2.

Configuring RichTables

Goal: Create dynamic, styled data tables for related lists (e.g., Order Products, Quote Lines).


1. Initializing the Table

Instead of a standard paragraph, you can insert a structured data grid:

  1. Insert Table: In the Section Editor toolbar, click the + button (or use the "Rich Table" menu item to select a Table type).
  2. Selection: This creates a dedicated RichTable block within your document section, specifically designed to iterate through multiple records.

2. Data Mapping (Table-Specific SOQL)

Just like paragraph/Rich Text blocks, tables require a data source, but they usually target Child Objects (or any related SFDC Object):

  1. Build Query: Open the Query Builder within the RichTable settings.
  2. Target Child Records: Select a child object (e.g., Negotiated Rate).
  3. Relational Filtering: Set the filter so the parent ID matches the current record.
  4. Example: OrderId equals {pv0}.
  5. Field Selection: Choose the columns you want to display (e.g., Product Name, Quantity, Unit Price, Total Price).

3. Table UI & Column Configuration

Once the query is saved, the RichTable interface allows for granular UI control:

  1. Column Mapping: The fields from your SOQL query appear as available columns.
  2. Header Customization: You can manually rename the headers (e.g., changing "Name" to "Role").
  3. Styling & Alignment: Use the columns and table style tab settings to:
  4. Set Column Widths (fixed or percentage).
  5. Set Text Alignment (e.g., Right-aligning currency values).
  6. Custom borders for better readability.

5. Previewing the Table

When you hit Preview Document to test the RichTable will:

  1. Identify the child records related to the current record/as defined in the soql query.
  2. Dynamically generate the necessary number of rows.
  3. Apply the styles and headers you defined.

https://www.youtube.com/watch?v=OGoAcOm_JJ8



Editor Tip: If a table has too many columns for a standard Portrait page, use the <Edit HTML> option or the Table Style Tab Properties to set the width to 100%.



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