Dynamic Filters increase the reporting capabilities of DocumentsCorePack by allowing you to pass dynamic values into the data query when loading data into your template.
Basically, they are variables that can be passed into the data query (when resolving relationships) in DocumentsCorePack templates.
The source for these variables can be either any field (attribute) of the root table (entity) for which the template is made or a user prompt that is defined within the template.

To use and understand Dynamic Filters, it is recommended to have some experience with basic template creation, along with the creation of relationships, relationships filters, and also user prompts.
If you are new to DocumentsCorePack our getting started article would be recommended to gather basic knowledge around those topics.
Prerequisites:
– DocumentsCorePack Server Based 2020.105 (Version & Upgrade Info)
– DocumentsCorePack Client Based 10.25 (Download here)
The below chapters will show the different options that dynamic filters offer based on a sample
and a description of where to find this and how to add this to your templates.
We also have a recording of a webinar available covering this feature in a video presentation.
Dynamic Filters explained by an example
In our example, we have a template based on accounts with a relationship to contacts. On top, we added fields to display the account name along with the phone number of the account.❶
In addition, we added a relationship to contacts four times in the given template. The tables will show us contacts…
❷… without a dynamic filter, as reference for the other options
❸… that have the last name that I entered in the Dialog during generation
❹… that have the same phone number as the account itself
❺… that are born after a specified date

For the filters applied in example ❸ (lastname) and ❺ (born after) we need to define user prompts in our template.

We are executing this template against a record with the following record by using the Create Document button from within the account form

After the initial step of selecting our template, we are presented with the Prompts dialog that asks for the additional user input defined in our templates.

After this, we completed the DocumentsCorePack Dialog by selecting to create a Docx document. In our result, we see the basic information of the account record ❶. as well as the data shown in Figure 6.
For the relationships we get:
❷… all contacts related to this account without any filter
❸… all contacts that have the last name that I entered in the Dialog (“Doe”)
❹… all contacts that have the same phone number as the account itself
❺… all contacts that are born after the specified data (06/30/1995)

How to Add/Edit a Dynamic Filter
in this section, we will not cover the general creation of relationships, relationships filters but will focus on the definition of dynamic filters.
To add a dynamic filter you have to Add/Edit a filter ❶ and Add/Edit a condition ❷ once you have opened the Condition dialog you will see an additional section called “Dynamic Filter” ❸.

In the drop-down in the Dynamic Filter section, you can either add fields from your root entity that can be found at the beginning of the dropdown list (see Figure 8).

Any Prompts that are part of your template can be found at the end of this dropdown (see Figure 9).

Pleaes Note: Any attribute that is not part of your document needs to be added to the “Additional Fields” section in the advanced template settings, otherwise the parameter will not be available during the merge process.
That’s it! We appreciate your feedback! Please share your thoughts by sending an email to support@mscrm-addons.com.
Known Issues:
Testing´ templates with user prompts does not work using the “Choose Data” option within Microsoft Word or when viewing results in the relationships designer. To test, you have to save the template and use the “Create Document” options from the DocumentsCorePack Dialog.