Skip to content

Template v1 Concepts

The template is the model based on which the PDF copy of an invoice, dunning reminder or account statement is rendered. It defines its contents and layout. The produced PDF document is intended to be distributed via email or postal service to customers, and it can be exported and archived. JustOn provides default templates, based on which you can define your own templates.

Version 1 of JustOn's PDF template mechanism is based on Salesforce's built-in Visualforce PDF rendering. JustOn provides a default template and a number of template details, based on which you can define your own templates.

Template Structure

The template is composed of a number of pre-defined containers that represent specific areas of the page - the header, footer, the invoice line item table, etc. Each container comprises text blocks that define the actual content displayed in the final document. For example, the header container contains text blocks for including addresses for sender and recipient, a company logo, and other invoice details.

Text blocks can include placeholders. These are symbols for fields of Salesforce or JustOn objects (like address fields or payment data), which are to be replaced with actual values upon PDF rendering.

When creating a PDF copy of an invoice, JustOn executes the following internal steps:

  • JustOn produces an intermediate HTML document based on the invoice template and using the data provided by the actual invoice.
  • The HTML document is then converted into a PDF using standard Salesforce functionality.

The template defines the structure and layout of the intermediary HTML document. That is, when customizing the template, you actually edit an HTML document.

For details about the template structure, building blocks, etc., see Default Template.

Template Variation

Usually, you have multiple templates that each serve a specific target. There are, basically, two ways to diversify templates:

  • Creating multiple templates for different targets, for example, different locales or specific customer groups
  • Using template details to customize specific parts for different purposes, for example, invoice, credit, cancellation.

Info

You can combine the two approaches.

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

Note

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.

For information about using template details, see Configuring Template Details.

Template Assignment

When setting up a Subscription, Opportunity or any other object for billing, you must specify a standard template for that object. This template is then assigned by default to all invoices created from that object.

As long as an invoice has the status Draft, you can assign another template to the invoice.