• Release History
  • Documentation
  • Back to www.mscrm-addons.com
  • Release History
  • Documentation
  • Back to www.mscrm-addons.com
home/Knowledge Base/Template Designer(DCP)/How to insert Condition Fields in DocumentsCorePack Templates

How to insert Condition Fields in DocumentsCorePack Templates

2180 views 2 Updated on February 28, 2023

Conditions allow you to define content that is either displayed or removed from the final document based on a certain condition (for example: field values in Dynamics 365).

This step-by-step description explains how to set conditions in our DocumentsCorePack (DCP) TemplateDesigner. In this example, we want to create a quote and choose between “Mr” and “Ms” depending on the gender of the recipient.

This webinar also covers this topic in detail.

Please note: As well as the method described in this article, Microsoft Word also supports conditions inside documents that can alternatively be used.

Step 1. Create a quote template
First, you must create a new template or open an existing one. Once the Word template is open, click the ❶ www.mscrm-addons.com tab on the top of the Word ribbon and ❷ press Insert MailMerge Fields to open the TemplateDesigner on the right side. More information about how to create DCP templates can be found here. Select the  ❸ Insert Field button.

Please note: Set the cursor ❹ at the position where you would like to insert a condition field. In our example, we want to set the condition in the subject line after “Dear” choosing between “Mr” and “Ms” based on the recipient, as you can see below.

A sample quote template.
Figure 1: Quote template

Step 2. Use the Condition field option
Press the ❸ Insert Field button. Select Insert Computed Item and then Condition field.

Select "Insert Computed Item" and then "Condition Field".
Figure 2: Insert Condition field

Step 3. Configure the setup of your condition fields
The Condition Field window opens. For further steps:

❶ Give your condition a descriptive name. It makes it easy to re-use existing conditions in a template.

❷ Enable the creation of an ELSE block and define the layout of the inserted condition fields, which in in this case is next to each other.

❸ Use the condition designer to create your condition. In this example, we want to create the condition for the entity Potential Customer (Contact). We want our condition to choose between “Mr” and “Ms” depending on the gender of the recipient. Therefore, we select in the first drop-down menu the field Gender and the operator as equals. Depending on the data type of the field, you have an additional control that opens a new dialog to select the compare value, which in this case is male. A more detailed description of the condition designer can be found here.

Configure your condition with the Condition Designer.
Figure 3: Configure your condition

In your template, you can see placeholders for the formatting options next to each other. Because you selected to insert an ELSE block, you have the second placeholder, as you can see in the figure below.

Sample appearance of the fields in the template.
Figure 4: Appearance of the fields in the template

Step 4. Set your custom text block
Within these placeholders, you can now enter the content of your conditions. In this example, IF Gender equals to Male it should display “Mr” and ELSE “Ms“.

The "if and else" block filled with content.

Figure 5: if and else block filled with content

Step 5. Save your template
Before you can use or test your template, you must save it. Use the Save Template option of the DocumentsCorePack TemplateDesigner to publish the template to Dynamics 365.

Save your template.
Figure 6: Save Template option

Step 6. Test your template
As you make changes to your template, you may want to test them quickly. A step-by-step description of how to test your template can be found here. Below you can see the result of our created template containing the set condition (highlighted). 

Sample result with a condition field set.
Figure 7: Result of your condition field

That’s it! We appreciate your feedback! Please share your thoughts by sending an email to support@mscrm-addons.com.

 

Was this helpful?

2 Yes  1 No
Related Articles
  • How to update the metadata in the DocumentsCorePack Template Designer
  • Working with Product Properties in DocumentsCorePack
  • How to work with the Relationship Manager
  • Using virtual tables in DocumentsCorePack
  • DocumentsCorePack Template Designer Settings
  • How to solve: Failed to connect to an IPC Port
Latest Articles
  • How to share the Connection of the DocumentsCorePack Connector
  • How to update the metadata in the DocumentsCorePack Template Designer
  • Working with Product Properties in DocumentsCorePack
  • How to work with the Relationship Manager
  • Using virtual tables in DocumentsCorePack
Popular Articles
  • Where do I find the Unique Organization name in Microsoft Dynamics 365?
  • DocumentsCorePack Template Designer – Getting Started
  • mscrm-addons.com Application Access for Dynamics 365 (App Access) – DocumentsCorePack
  • DocumentsCorePack Online Service Configuration
  • Step-by-Step: How to configure a One-Click-Action
Top Rated Articles
  • IMPORTANT information for Dynamics 365 online customers using DocumentsCorePack and/or AttachmentExtractor
  • How to activate the DocumentsCorePack connector for PowerApps & Microsoft Flow
  • Step-by-Step: How to configure a One-Click-Action
  • Online Services: Required Application Permissions
  • Where do I find the Unique Organization name in Microsoft Dynamics 365?
Categories
  • *News and General Infos* 51
  • Webinars 35
  • Template Designer(DCP 179
  • DocumentsCorePack(DCP 192
  • TelephoneIntegration (TI 65
  • AttachmentExtractor (AE 62
  • PowerSearch (PS 48
  • ActivityTools (AT 59
  • SmartBar (SB 53
  • GroupCalendar (GC 46
Our Vision

“We see it as our purpose to provide products that simplify and speed up our customers’ Microsoft Dynamics 365 experience.”

Knowledgebase
LogIn
mscrm-addons.com
  • Products
  • Online Shop
  • Downloads
  • My Account
About Us
  • About Us
  • Case Studies
  • Newsletter
  • Partner Program
  • Contact
Support
  • Support
  • Terms & Conditions
  • Documentation
  • Webinars
  • Legal Documents
  • Impressum
  • © 2022 www.mscrm-addons.com. All Rights Reserved.