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.