PDF Templates | Adding and managing sections

On the PDF template page, each section has a set of control buttons:

Screenshot: Available buttons for a section: New, Delete, First, Up, Down, Last

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:

  • Select OK if you are sure.
  • Select Cancel to return to the PDF template page without deleting the section.

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.

Tip

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:

Screenshot: Layout picklist field annotated for a PDF template section

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:

  • Conditional sentences that, when included, you want to form part of a standard paragraph.
  • Tables that you want to form part of the normal flow of text.

New Line

Display this section on a new line.

For example, use New Line for sections containing:

  • Conditional paragraphs.
  • Images that you do not want to flow text around.

New Page Before

Display this section on a new page.

For example, use New Page Before for sections containing:

  • Blocks of conditional text that you want to give prominence or to separate from surrounding text when they are included.
  • Longer tables of supporting information.
  • Appendix content.

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:

Screenshot: Condition field for a section annotated

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.

  • Include a section in the PDF template for each employee grade.

  • Use Condition on each section to evaluate a Team Member's grade.

    Include the section if the value of the Grade picklist field matches the condition. For example, to use a condition from the Team Member object:

    fHCM2__Grade__c=='B'

    Note the quotation marks around the picklist value in the condition.

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.

  • Include sections in the PDF template for salary, bonus, and commission.
  • Use a Condition on each section to decide which sections to include for each team member. For example:
  • The Salary section has no condition because all team members receive a salary. The letter confirms existing salary for team members who are not getting an increase.
  • For the Bonus section, include the section if the team member gets a bonus. Assuming there is a custom Bonus field on the Employment Record:

    fHCM2__Current_Employment__r.Bonus__c<>''

  • For the Commission section, include the section if the team member is on a Commission Plan. Assuming there is a custom Commission Plan field on the Employment Record:

    fHCM2__Current_Employment__r.Commission_Plan__c<>''

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:

Screenshot: Repeat, Sort by, and Condition fields for a PDF template section

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:

  • To repeat a section once for each Objective for the Team Member, enter:

    fHCM2__Objective__r

    Use the r to indicate a related object.

  • To repeat a section once for each skill held by the Team Member, enter:

    fHCM2__Skill__r

    Use the r to indicate a related object.

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:

fHCM2__Start_Date__c

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:

fHCM2__Status__c='Active'

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:

Copy
Example repeating section
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:

Annotated image: How four merge fields in a repeating section produce PDF content with associated text