Including a Subdocument in a Document or Notification Template

Subdocuments are a way to manage shared information existing in multiple document template from one place, such as headers, footers, signatures, etc..

Subdocuments allow users to make changes in a single document that may be referenced / reflected by many other document templates.  This is useful for common document template components such as standard document headers or footers.

Subdocument

A subdocument is created the same way a regular document template is created, refer to Document Templates for details about creating a document template. 

Make sure to choose a name that will not require changing in the future, changing the document name will require updating that information in all the document templates.

In the subdocument, the text and/or images placed in the header or footer of the document will be ignored.

Designing a subdocument

Subdocuments are designed the same way a document is created with some consideration.

  • Only the body of the subdocument will be included in the referenced document. Header and footer will be ignored.

  • There will always be a line break ¶ following each subdocument.

  • Ensure that the subdocuments have the same functional area as the parent document! For example, if the document relates to the Permit functional area, so should the subdocument. This is because the identifier for the record is passed to the subdocument and is used by the subdocument to query data for merging into the template. The exception would be cases where the subdocument does not have any merge fields, in which case the functional area of the subdocument will not matter.

Including a subdocument

To include a subdocument in a document template use the following tag:

[[Subdocument:Name of Subdocument]]

If you want to apply a common header and footer to your documents, follow these steps:

  1. Create separate “header” and “footer” document templates.

  2. In each of the separate documents, ensure that your header or footer text is within the body of the document, not the header or footer of the document.

  3. In the document template that is inheriting the header and footer:

    1. Refer to the header template in the inheriting document template’s header section (e.g., [[Subdocument:ADEM Header Template]]).

    2. Refer to the footer template in the inheriting document template’s footer section (e.g., [[Subdocument:ADEM Footer Template]]).

Building a Variable Subdocument Merge Field

If you have a subdocument that will be variable based on another field, then you can ‘build’ a merge field, as long as you have the variable data available.

[[Subdocument: MSGP-<<[TAG]>>]]

For a more complex situation:

Below shows a foreach that will pull out a specific set of data, as well as the IndexOf() and Remove() functions to pull a specific part of a field to use as part of the document name.

<<foreach [sectorInfoItem in strmwtrMsgpNoi.sectorInfo]>> [[Subdocument: MSGP-<<[sectorInfoItem.sector.Remove(sectorInfoItem.sector.IndexOf(":”), sectorInfoItem.sector.Length-sectorInfoItem.sector.IndexOf(":”))]>>]] <</foreach>>

Tips & Restrictions

  • The subdocument will work even if the subdocument template status is inactive.

  • The subdocument may contain insertable fields, but the field will only be populated if the subdocument is in the same functional area as the main document.

  • The subdocument will work with different functional areas if there are no references to insertable fields.

  • At the end of subdocument a line break ¶ will be placed, which means a continuous line of text is not possible after the subdocument.