The insert as static document button is a very useful functionality if it comes to creating templates in DocumentsCorePack Template Designer. Its functionalities can be expanded to insert not only static documents but also sub-templates. In the course of this article, you will learn how to do so.
First of all, you need to open two templates, but you could also create two totally new ones.
Learn which fields can be added to a template here.
You need one for your main entity and one for your sub-entity. They are the base for all further actions.
Description on how to create a sub-template to a static document
Create a template for your main entity and the sub-entity.
(In our example, the main template is based on the entity Account and the sub-template is based on the entity Contact.)
Build up a relationship between the entity of the sub-template and the main template. Open the DocumentsCorePack Template Designer with a click on
the ❶ [Insert MailMerge Fields]-button, switch to the Additional tab, and click on ❷ Add Relationship/Entity and select ❸ All contacts.
Now navigate to the Insert Field Button > Insert Static Item > Static Document within the Template Designer. The following dialog will pop up:
Within the Static Document-dialog,
❶ Select the ID-field of the related record.
(in our example, this is Contact ID)
❷ You can do via the search field for the ID-field
❸ Check the checkbox next to “Provide the selected field as a parameter” to enable
the sub-template to be merged with the ID-field.
❹ Click on the [Select Document]-button to select the static document you would like to insert
❺ The selected document is shown
❻ Click on the [OK]-button to proceed
If you go back to your main template, you will note that the following field has been added to it:
Congratulations! You have created your very first static sub-template!
Our result looks like this in the merged template:
- If a sub document is inserted within a table, some limitations of Word apply. Elements and controls that are part of the sub document which can not be part of a table might cause unexcpected behaviour (e.g. page breaks).
- A sub document does not work when it is inserted in the header or footer section of a template.
That’s it! We appreciate your feedback! Please share your thoughts by sending an email to firstname.lastname@example.org.