Template Versioning provides a solution framework of document versioning at the template level to track template versions against generated documents. Your organization's policies, requirements, legal and business practices may change over time, requiring templates to be updated. Rather than manually keeping track of template iterations, you can use template versioning to track and manage every version of your template throughout its lifecycle. Template versioning maintains those different versions as the template changes, giving template admins the ability to activate specific template versions based on their needs and to observe how the template looked at every stage in the authoring process. Template versioning applies to all types of templates in your library.

To summarize, template versioning allows template admins to:

  • Survey older contracts by viewing their associate template version to understand what was in the template at generation.
  • Revert to previous template versions.
  • Clone template versions to begin a new template lifecycle.
  • Understand the growth and evolution of a given template.

The following sections in this guide provide step-by-step instructions for managing templates in X-Author for Contracts 2.0 for orgs with Template Versioning enabled:

The behavior for versioned templates is different where described. All other X-Author for Contracts 2.0 functionality remains unchanged. 

To use Template Versioning it must be enabled for your org. For more information, see Configuring Template Versioning topic in the Contract Management on Salesforce Administrator Guide.

How Template Versioning Works

Each agreement or clause template in your org (with or without template versioning enabled) always consists of one template and multiple child references to clauses and sections contained in that template. For every instance of that template, there is always only one template that can be considered active (the version selected by the user to generate the contract or the version of the clause inserted into an agreement template).

More specifically, whenever a new template is created by any means, one instance of the template is created, stored in the Template object in Salesforce, and any clauses in the template are stored in the Template Clause Reference. The Template object has a master-detail relationship with the child object, as shown in the following figure.

Template Versioning preserves the same template, called the Header Template, which has a one-to-one relationship with the active version of the template and its child objects, and a one-to-many relationship with other versions of the template, which also have versioned clause and section references, but are considered inactive.

Template Versioning introduces two new objects:

  • Template Version – a detail object of the master Template object
  • Template Clause Reference Version – a child object of Template Version that stores nested clause references

When a user creates a new version of a template, the version information is incremented (e.g. from "1.00" to 2.00") and stored in the Template Version object and its child object. When a template version becomes the active version, data from the Template Version object is copied to the Header Template object and that template version becomes the newly active version of the Header Template.