The template designer is a built-in word processor with options for controlling document formatting and selecting merge fields. The word processor has an option to view the html source code used to create the document. Those familiar with html can directly edit the source code for granular control and fine tuning.
1. Inserting Merge Fields
Merge fields use the same format as standard Salesforce merge tokens. Fields can be added for the following:
- Any field from the underlying object or the objects related lookups (two levels deep).
- Any field from the running user’s profile.
- Any field from your organization’s profile.
- A system field.
2. Inserting Related Lists
Fields from a related object are available to be placed in a table of repeatable rows. Carefully use the Sort Order and Filter clauses to order and narrow the list. These options use standard SOQL syntax. Examples for a Participant-related list are:
The related list sort order syntax is as follows:
Field Name <order direction>
- Where Field Name is the API name of a field in the related object.
Where order direction is an optional parameter to determine if the list sorts in ascending or descending order.
RecordType.Name asc, Name desc
The related list filter syntax is as follows:
<Field Name1> = "xyz" and <Field Name 2> = 123
- Where <Field Name> is the API name of a field in the related object.
- Where "xyz" and 123 are the values you expect to see in the related list.
RecordType.Name = "Account" OR RecordType.Name = "Contact"
advpm__Billable_Account__c = true and RecordType.Name = "Account"
- The string or text based Filter Field Values must be enclosed in double quotes as displayed in the examples above.
- When including multiple fields within your filter clause, enclose them with parentheses for appropriate logical grouping.
Enabling this option will not display the column titles in the heading of the list.
Show as Stacked
Enabling this option shows each related record in the format of an index card (each column is on a new line) as opposed to a single row.
3. Inserting Conditional Blocks
Inserting conditional output blocks can be implemented using checkbox fields (boolean). Conditions are based on the TRUE or FALSE value of a specified field.
Choose a checkbox field and determine if output should be generated when TRUE or when FALSE. Consider using custom formula fields for this feature. Just make sure the formula result is a Checkbox field (boolean).
4. Inserting Other Templates
Templates can be inserted into other templates that share the same base object. Use the System base object to create templates that can be inserted into any template without regard to sharing a common base object.
Inserting a Template allows the reuse of other AdvoDoc templates within the Template you are designing. This reduces repetition of commonly used blocks of merge text. Typical use cases include signature blocks and common clauses.
5. Other Designer Features
- Use the Source button to view and/or directly edit the html source code (see advanced below).
- Use the right-click context menu to modify table properties (helpful for related lists).
- Use the Preview option to view a the template merged with a sample record.
- Use the Print preview button for a quick visual of the template (the document is not merged).
Please see the Advanced Techniques article for additional document design options.
Add your comment