Unique Template Keys

Every template in a changeset needs a Unique Template Key. The key links a template across orgs:

  • If the target org has a template with the same key, the migrated file is added to it as a new version, and that template keeps its name.
  • If the target org has no template with the key, a new template is created with it.

Flows that name their templates by key keep working after a migration. Set a key in the Unique Template Key column on the DocGen Templates page, or while you create a changeset. A key can contain lowercase letters, numbers, dots, underscores and hyphens, and it must be unique within the org.

The DocGen Templates page with the Unique Template Key column, one key being edited

Create a Changeset

  1. In the source org, open Document Generation → Template Migrations. The Outgoing tab lists the changesets sent from this org.

The Template Migrations page on the Outgoing tab, listing three changesets with their status

  1. Select Create Changeset and enter a Changeset Name of at least 10 characters.
  2. Select up to 25 templates. Draft templates are not listed. If a selected template has no key, a key is suggested from its name, and you can edit it.

The Create Changeset dialog listing templates with their source object, Unique Template Key, type and version

  1. Select Next, choose the org to migrate into, and select Create. The production org is marked Production.

The changeset is validated automatically. In the source org, its details show the status and how many templates succeeded or failed.

Validation

CloudFiles checks that the target org has every object, field and relationship each template uses. If any template fails, the whole changeset fails and nothing is copied. In the target org, the changeset’s details list what is missing under Validation Issues, for example FIELD_NOT_FOUND. Fix the target org or the template, then create a new changeset.

A failed changeset showing a template with Validation failed and a FIELD_NOT_FOUND validation issue

Deploy or Reject a Changeset

CloudFiles does not send a notification when a changeset arrives, so check the Incoming tab.

  1. In the target org, open Document Generation → Template Migrations and select Incoming.
  2. Open a changeset’s row menu and select Details. The Match column shows the template in this org that each migrated template will update. An empty Match means a new template will be created.
  3. When the status is Validated, select Deploy to copy the templates, or Reject to cancel the changeset.

When the copy finishes, the changeset shows Completed and each template shows Success. Tags are not copied with a template.

A completed changeset with its source and target orgs and two templates marked Success