CaseCloud Help

Using the HotDocs Document Templates

Updated on

This tab provides a list view of all existing template mappings in your organization.  From this view, you can:

  1. Access your saved list views for the HotDocs document template.
  2. Create a New HotDocs document template.
  3. Create, delete, or edit the available list views for the HotDocs document template.
  4. Access, delete, or edit the available HotDocs document template from the list.

Creating or Editing a HotDocs Document Template

When you click New or Edit an existing record, an editable form appears where you can configure the mapping.

Basic Information

This is the primary setup section for the mapping.

  1. Name: A friendly name for your template mapping (e.g., "Sample Employment Agreement").
     
  2. Description: An optional description for the template mapping.
     
  3. Object: The Salesforce object that this template will be available for (e.g., Account, Contact, Matter).
     
  4. Record Type: If the selected object uses record types, you can specify one to make this template available only for records of that type. 
     
  5. Active: Check this box to make the template mapping available for users.
     
  6. Select HotDocs Template: This button opens a modal that allows you to browse your HotDocs workgroups and select the specific template you wish to map.
Template Variables Mapping

This section lists all the variables found in your selected HotDocs template. Your task is to map each variable to a corresponding field in Salesforce.
 

  1. Template Variable Name: The name of the variable from the HotDocs template.
     
  2. Variable Type: The data type of the HotDocs variable, such as Text, Number, Date, Boolean, Multiple Choice, Single Select, Multi Select, Checkbox, or Table/Repeat. Only supported variable types can be mapped to Salesforce fields. See Supported HotDocs Variable Types for details.
     
  3. Mapped Field: This input is where you define the source of the data. Based on whether the variable is of a repeat nature, the input control displayed will allow the user to select a related object.
     
    1. Field Mapping: For simple variables (Text, Number, Date), click the </> insert merge button icon to map a variable to a field on the primary object (e.g., the Account record), click the field picker icon, and select the desired field. You can also access fields on parent records (e.g., {{Parent.Owner.FirstName}}).
       
    2. Related Object Mapping: For table or repeat variables, click the Select Related Object button. This allows you to choose a related list (e.g., Contacts, Cases) to populate with repeating data (such as a list of cases or contacts for an account).
       
      1. After selecting a related object, you can map each column of the repeating data to a field on that related object.
         
      2. You can also apply filters to the related data. For example, you can specify that only Contacts where the "Account" equals "Acme" and "Priority" equals "Medium" should be pulled into the document.
         
  4. Sorting: Use the menu to sort the list alphabetically by variable name or type.
     
  5. Quick Filters: Use the search box to filter the list by variable name. You can also use the type dropdown to show only variables of a specific data type (e.g., Text, Date, Table).
     
  6. Quick Add: If you need to add a variable that isn't in the list, use the "Add Variable" fields at the bottom. Enter the exact variable name, select its type, and click Add to include it in the mapping grid.
Supported HotDocs Variable Types

Use the following table to determine which HotDocs variable types are supported when mapping Salesforce data to a HotDocs document template.

HotDocs Variable TypeDescriptionExample ValuesSupport Status
TextStores text or alphanumeric values.100 Main StreetSupported
NumberStores numeric values.1045Supported
DateStores calendar dates.01/15/2026Supported
Boolean / True-FalseStores a value of True or False.TrueSupported
CheckboxRepresents an individual checkbox that can be selected or cleared.SelectedSupported
Single SelectAllows users to select one value from a list of available options.CaliforniaSupported
Multiple ChoiceAllows users to select one option from predefined choices.Low, Medium, HighSupported
Multi SelectAllows users to select multiple values from a list.Texas, California, FloridaSupported
Table / RepeatStores repeating rows of data.John Smith, 555-55-5555, Father
Jane Smith, 555-55-5554. Mother
Supported
ImageStores image-based content.image.jpg, image.pngNot Supported

Multi-Level Relationship Mapping

You can now map Table and Repeat variables across multiple levels of related Salesforce objects. This enhancement lets you pull data from deeply nested child relationships directly into a HotDocs repeat region.

For example, you can map data across the following hierarchy:

Account → Contacts → Cases → Events

Previously, you could select only one level of related objects (such as an Account’s Contacts). With this update, you can traverse up to five levels of nested child relationships.

Filter Across Multiple Relationship Levels

When your mapping uses a multi-level relationship (for example, Account → Contacts → Cases), the filter builder displays an additional Object column for each condition. This allows to specify which object level the condition applies to and also ensures each condition targets the correct object in the hierarchy.

For example, in a Contacts → Cases chain, you might want condition 1 to filter on the Contact’s Department field and condition 2 to filter on the Case’s Status field. The Object column lets you direct each condition to the appropriate level.

When you use Custom Logic across multiple levels:

  • Condition numbers are sequential across all objects.
  • The system automatically applies each condition to the correct object when generating the underlying query.

HotDocs Document Template Sync Status

The Template Sync Status field on HotDocs Document Template indicates whether the mapped template in Salesforce is aligned with the latest version available in your HotDocs Advance library. A background job can be scheduled to run periodically to check for newer published versions of your mapped templates. 

Possible values in this field are:

  • Up-to-date: The mapping is using the latest published version of the template.
  • Out of date: A newer version of the template has been published in HotDocs. You should edit this mapping and re-select the template to update its version and variables.
  • Unknown: The template version is no longer available in HotDocs Advance.

Scheduling the Template Sync Apex Job

For the sync status to be updated automatically, a Salesforce administrator must schedule the background Apex job. You can do this in one of two ways:

Method 1: Schedule from the Salesforce UI

This is the simplest method, but it requires a manual step before upgrading the package in the future.

Steps to Schedule:

  1. Navigate to Setup > Apex Classes.
  2. Click the Schedule Apex button.
  3. Configure the job schedule:
    • Job Name: HotDocs Template Version Sync
    • Apex Class: Search for and select the class named HotDocsTemplateVersionSyncSchedulable.
    • Frequency: Choose your desired frequency (e.g., "Daily").
    • Preferred Start Time: Select a time during off-peak hours (e.g., 2:00 AM).
  4. Click Save.
Method 2: Schedule Programmatically

This method is recommended as it prevents the job from locking the Apex classes during an installation, making package upgrades smoother.

Steps to Schedule:

  1. Navigate to Setup > Developer Console.
  2. In the Developer Console, click Debug > Open Execute Anonymous Window.
  3. Paste and execute the following code. 
String jobName = 'HotDocs Template Version Sync';

// This is a CRON expression that defines the job's schedule.
// It consists of 6 parts: Seconds Minutes Hours Day_of_month Month Day_of_week
// The example below runs at 2:00 AM every day.
// You can customize this. For example, '0 0 3 ? * MON-FRI' would run at 3:00 AM on weekdays.
String cronExpression = '0 0 2 * * ?'; // This schedules the job to run daily at 2:00 AM.

System.schedule(jobName, cronExpression, new hdocs.ScheduleDispatcher(hdocs.HotDocsTemplateVersionSyncScheduler.class));
Previous Article Reports & Dashboards
Next Article Apex Invocable Methods Available Within the Connector
Still need help? Click here!
AdvoLogix® is a registered trademark of AdvoLogix.com LLC a Texas Limited Liability Company. All references to other trademarks belonging to third parties that appear on this website, documentation, or other materials shall be understood to refer to those registered trademarks owned by others, and not to any trademark belonging to AdvoLogix. Otherwise, all material herein is the copyright of AdvoLogix.com LLC. All Rights Reserved.