PDF Templates | Adding and managing sections
On the PDF template page, each section has a set of control buttons:
Use the buttons as follows:
Button | Description |
---|---|
New |
Inserts a new section below the current section. There is no limit to the number of sections you can have in a PDF template. Use the Layout options to control breaks associated with each section. |
Delete |
Deletes the current section. You are asked to confirm deletion:
|
First |
Moves the current section to appear first in the template, immediately following the Header on the first page of the document when it is rendered as a PDF. |
Up |
Moves the current section up one position in the main section content. |
Down |
Moves the current section down one position in the main section content. |
Last |
Moves the current section to appear last in the template, immediately before the Footer on the last page of the document when it is rendered as a PDF. |
The maximum character limit per PDF template section is 32,768 characters. You can split content into multiple sections to include all relevant content in a long document.
Controlling section breaks
On the PDF template page, each section has a Layout picklist:
Layout options enable you to control how a section is displayed:
Option | Description |
---|---|
None |
Defaults to Inline. |
Inline |
The default. Display this section immediately following the previous section with no line or page breaks. For example, use Inline for sections containing:
|
New Line |
Display this section on a new line. For example, use New Line for sections containing:
|
New Page Before |
Display this section on a new page. For example, use New Page Before for sections containing:
|
New Page After |
Display the section after this section on a new page. |
Conditional sections
On the PDF template page, each section has a Condition field:
Conditions control when a section is displayed. The condition must be met before the section is included in a document based on the PDF Template.
- Conditions can include formulas.
- Conditions can operate across objects. For example, if you are using a PDF template from the Team Member object, you can use Condition to evaluate a field on the Employment Record object. Follow the rules for using Merge Fields.
- By default, Condition is blank. A blank Condition means that the section is always included in documents based on the template.
- You do not need to include a Condition to exclude a section if the field or fields it uses contain no data. Sections with no data are automatically excluded from the PDF document.
Example |
PDF template setup When used from Team Member records... |
Result |
---|---|---|
Your organization uses multiple employment contracts, matching a contract to the level of benefits available to each grade of employee. |
|
Documents based on the template include only those sections relevant to each grade. The example condition includes the section when the team member's Grade is B. |
Compensation award letters contain sections relating to base salary, bonus, and commission. Letters are sent with just the relevant sections included. |
|
Documents based on the template include only those sections relevant to each team member. |
Repeating sections
On the PDF Template page, each section has a Repeat field with associated Sort By and Condition fields:
These fields control section repetition in a document based on the PDF Template.
Complete the fields as follows:
Field |
Description |
---|---|
Repeat |
The API Name of the object containing the values you want to display in the repeating section. The object holding the values you want must be accessible from the object from which you send the PDF. For example, when sending a PDF from a Team Member record:
|
Sort By |
The API Name of the field on the object entered in Repeat you want to use to sort the sections. For example to sort Objectives by Start Date, enter:
|
Condition |
The condition that controls when the section is repeated. The section repeats as long as the Condition is met. For example, to repeat a section for each active Objective, excluding objectives with any other status, enter:
|
In the content of the section enter any text and Merge Fields you want to include.
For example, if you are using repeated sections to list active objectives, your repeating section could include:
Your objective: {!Name} with start date: {!fHCM2__Start_Date__c} is currently
{!fHCM2__Status__c} and has a progress rating of {!fHCM2__Progress__c}.
When combined with Layout set to New Line, this generates a PDF with content as follows: