action.skip

Configuring Template Details

← Configuring PDF Creation

Template details are a means to override specific fields of a parent template in order to cover specific use cases. Together with the default template, JustOn ships template details for credits, cancellations, dunning reminders, and account statements. These template details overwrite certain fields of the parent template depending on the object (Invoice or Statement) and the object type (Credit or Cancelation in case of invoices).

Info

When using Liquid-based templates and the JustOn PDF service, you still need template detail records to customize email texts and counters according to your use cases.

Template Detail Concepts

Template Detail objects are in a master-detail relationship to a Template object. That is, a template detail is always associated to a template.

By default, template details include the following fields and, hence, can overwrite the corresponding template fields:

Field Type Notes
Balance Columns Text (255)
Balance Types Long Text Area (32768)
Counter Text (255)
Custom CSS Long Text Area (32768)
Display Type Text (255)
Email Body Long Text Area (32768) You must use either Email Body or Email HTML Body in both the template and its associated template details for the overwrite mechanism to work.
Email HTML Body Html (32768) You must use either Email Body or Email HTML Body in both the template and its associated template details for the overwrite mechanism to work.
Email Subject Text (255)
Info Left Long Text Area (32768)
Info Right Long Text Area (32768)
Override Labels Long Text Area (16384)
PDF Name Text (255) The allowed characters include the alphanumeric characters a-z A-Z 0-9 as well as the underscore _ and hyphen - characters.
Table Columns Text (255)
Text 1 Long Text Area (32768)
Text 2 Long Text Area (32768)
Text 3 Long Text Area (32768)

If a template detail field is empty, JustOn uses the value as defined in the parent template. The value n/a in a template detail field will produce an empty (and therefore "invisible") field without falling back to the value set in the template.

Certain business use cases require to overwrite or hide template fields that are not covered with template details. To this end, you add new custom fields to the template detail that correspond to the template fields. They must have the same API name – so the template field FieldName__c is FieldName__c on the template detail.

For details about the template fields (its building blocks and the corresponding contents) see Default Template.

JustOn choses the template detail to apply based on its name and the following criteria:

Object Criteria Type (example) Class (example)
Invoice The detail is chosen based on the Type field of the invoice. If the type is empty, JustOn tries to use the Class field. Cancelation Invoice
Credit
Dunning The detail is chosen based on the Type field of the dunning. The type is directly linked to the dunning level and uses the same name. Level 1
Reminder 1
Account Statement If this detail is present, it is always applied when creating account statements.

Note

The template detail name must correspond to an existing invoice type or invoice class or, respectively, to an existing dunning level.

If there is no specific template detail available for a certain use case, like dunning, for example, JustOn uses the information as defined in the corresponding invoice template, including the defined text blocks, the counter, etc.

Creating New Template Detail

Generally, JustOn recommends to use template details to customize specific template parts for different purposes, for example, invoice, credit, cancellation. To create a new template detail:

  1. Open the template to be edited.
  2. In the Template Details section, click New Template Detail.
  3. Specify at least the template detail name and the parent template assignment.

    You can edit the other information later as required.

  4. Click Save.

Note

The template detail name must correspond to an existing invoice type or invoice class or, respectively, to an existing dunning level.

Info

Alternatively, you can also clone an existing template detail. This creates a new template detail, copying the contents of the original template detail.

Modifying Template Detail

Modifying template details involves editing the fields that are intended to overwrite template fields.

Info

You cannot change the parent template assignment. To assign a template detail to another parent template, clone it and save the copy with the new template assignment.

Note

The following examples illustrate the behavior. Make sure to adjust the configuration to cover your use cases.

Overwriting Template Field

Assume, for example, you need a dedicated footer for cancellations. The corresponding template field is Footer__c, its data type is Long Text Area. Here is what you do:

  1. Navigate to the fields list of the Template Detail object.
  2. Create the following new field.

    Field Label API Name Data Type
    Footer Footer Text Area (Long)

    This makes the Footer field available on template details, allowing for overriding the template footer.

  3. Open the invoice template to be edited.

  4. In the Template Details section, click Edit in the row of the Cancelation template detail.
  5. In the Footer field, specify the information as necessary.
  6. Click Save.

    This overwrites the template footer when producing cancellations.

Info

Your template details for other use cases, like credits or statements, now also include the Footer field. But as long as you leave it empty, JustOn uses the value as defined in the parent template.

Hiding Template Field

Assume you do not want any footer to be printed on PDF files for account statements:

  1. Open the invoice template to be edited.
  2. In the Template Details section, click Edit in the row of the Account Statement template detail.
  3. In the Footer field, enter n/a.
  4. Click Save.

    This produces an empty, and therefore "invisible", Footer field.