News.mscrm-addons.com BlogHello and welcome to our blog! What can we do for you? Are you looking for further technical information or step-by-step instructions to our products? Or would you like to read the latest news on mscrm-addons? Please feel free to browse our blog for detailed information and to share our posts! https://www.mscrm-addons.com/BlogHow to insert Condition Fields in DocumentsCorePack Template Designerhttps://www.mscrm-addons.com/Blog/PostId/10092/insert-condition-field*Features / News*,DocumentsCorePack (DCP),DCP 365Thu, 07 Jun 2018 08:03:03 GMT<p style="text-align: justify;">Certain properties of DocumentsCorePack templates consist of conditions based on Dynamics 365 fields. The Condition field property allows you to define dynamic content that is either displayed or removed from the final document based on a certain&nbsp;condition.&nbsp;</p> <p style="text-align: justify;">This step-by-step description will show you how to set conditions in DocumentsCorePack Template Designer. In this example, we want to create a quote and choose between Mr and Ms depending on the gender of the recipient.&nbsp;</p> <p style="text-align: justify;"><span style="color: #0077b3;"><strong>Step 1: Create a quote template</strong></span><br /> First, we need to create the basic layout of the template. Clicking on the <strong>[Insert MailMerge Fields]</strong>-button in the www.mscrm-addons.com command bar will open the DocumentsCorePack Designer on the right side. More information about how to create DocumentsCorePack templates can be found <a href="http://www.mscrm-addons.com/Blog/PostId/9941/how-to-create-documentscorepack-templates">here</a>.&nbsp;</p> <p style="text-align: justify;">The figure below shows an example&nbsp;template of a quote.&nbsp;&nbsp;</p> <div class=" data-plugin-options="> <div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"><a title="Quote Template" href="/Portals/0/Blog/Insert_Condition_Fields/Figure1_Quote_example.png"><img alt="Quote Template" class="img-responsive" src="/Portals/0/Blog/Insert_Condition_Fields/Figure1_Quote_example.png" width="390,5" height="437" /> </a></div> <div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"><em>Figure 1: Quote Template</em></div> </div> <p>&nbsp;</p> <p style="text-align: justify;"><span style="color: #0077b3;"><strong>Step 2: Use the Condition field option </strong></span><br /> After creating your template, please 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 <span style="text-align: justify;">like you can see highlighted in yellow in the figure above</span>. Then, go to Insert Computed Item and select Condition field.&nbsp;</p> <p style="text-align: justify;"> </p> <div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"><a title="Insert condition field" href="http://www.mscrm-addons.com/Portals/0/Blog/Insert_Condition_Fields/Figure2_Condition_field.png"><img alt="Insert condition field" class="img-responsive" src="http://www.mscrm-addons.com/Portals/0/Blog/Insert_Condition_Fields/Figure2_Condition_field.png" width="339" height="179,5" /></a></div> <div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}">Figure 2: Insert Condition field<br /> <br /> <br /> <br /> </div> <p style="text-align: justify;"><span style="color: #0077b3;"><strong>Step 3: Configure the setup of your condition fields&nbsp;</strong></span></p> <p style="text-align: justify;"><span style="color: #0077b3;"><strong> </strong></span></p> <div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}" style="text-align: justify;"><span style="color: #0077b3;"><strong><a title="Configure condition setup" href="http://www.mscrm-addons.com/Portals/0/Blog/Insert_Condition_Fields/Figure3_configure_condition.png"><img alt="Configure condition setup" class="img-responsive" src="http://www.mscrm-addons.com/Portals/0/Blog/Insert_Condition_Fields/Figure3_configure_condition.png" width="362,5" height="384" /></a></strong></span></div> <span style="color: #0077b3;"><strong> <div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}" style="text-align: justify;">&nbsp;</div> </strong> <div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}" style="text-align: justify;"><span style="color: #7f7f7f;">Figure 3: Configure your condition</span></div> </span> <p>&nbsp;</p> <p style="text-align: justify;"><span style="font-size: 24px; color: #0077b3;">❶&nbsp;</span>Give your&nbsp;condition a descriptive name. It makes it easy to re-use existing conditions in a template.</p> <p style="text-align: justify;"><span style="font-size: 24px; color: #0077b3;">❷</span> Enable the creation of an else block and define the layout of the inserted condition fields - in this case next to each other.&nbsp;</p> <p style="text-align: justify;"><span style="font-size: 24px; color: #0077b3;">❸</span>&nbsp;Use the condition designer to create your condition. In this example, we want to create the condition for the entity "Primary Contact (Contact)". We want our condition to&nbsp;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 as operator equals. Depending on the data type of the field you either have an additional control that opens a new dialog to select the compare value - in this case, Male.&nbsp;&nbsp;</p> <p style="text-align: justify;"><span style="background: none 0% 0% / auto repeat scroll padding-box border-box transparent; border-color: #777777; border-style: none;">A more detailed description of the condition designer can be found&nbsp;</span><a href="http://www.mscrm-addons.com/Blog/PostId/10057/condition-designer-dynamics-365" style="background-color: #ffffff;">here</a><span style="background-color: transparent;">.</span></p> <p style="text-align: justify;">Below 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 like you can see in the figure below.&nbsp;</p> <div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}" style="text-align: justify;"><a title="Appearance of the fields in the template" href="http://www.mscrm-addons.com/Portals/0/Blog/Insert_Condition_Fields/Figure4_Condition_fields.png"><img alt="Appearance of the fields in the template" class="img-responsive" src="http://www.mscrm-addons.com/Portals/0/Blog/Insert_Condition_Fields/Figure4_Condition_fields.png" /></a></div> <div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}" style="text-align: justify;">Figure 4: Appearance of the fields in the template</div> <p>&nbsp;</p> <p style="text-align: justify;"><span style="text-align: justify; color: #0077b3;"><strong>Step 3: Set your custom text block&nbsp;<br /> </strong></span>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".</p> <p style="text-align: justify;"> <div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}" style="text-align: justify;"><a title="Custom text block " href="http://www.mscrm-addons.com/Portals/0/Blog/Insert_Condition_Fields/Figure5_Content.png"><img alt="Custom text block " class="img-responsive" src="http://www.mscrm-addons.com/Portals/0/Blog/Insert_Condition_Fields/Figure5_Content.png" /></a></div> <div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}" style="text-align: justify;">Figure 5: Custom text block<br /> <br /> </div> </p> <p style="text-align: justify;"><span style="text-align: justify;"><strong style="color: #0077b3;">Step 4: Save your template</strong><span style="color: #0077b3;"><strong><br /> </strong></span></span><span style="background-color: transparent;">Before you can use or test your template you have to save it.&nbsp;</span><span style="background-color: transparent;">Either you save your template locally with the standard&nbsp;</span><span style="background: none 0% 0% / auto repeat scroll padding-box border-box transparent; border-color: #777777; border-style: none;">Save</span><span style="background-color: transparent;">&nbsp;or&nbsp;</span><span style="background: none 0% 0% / auto repeat scroll padding-box border-box transparent; border-color: #777777; border-style: none;">Save as&nbsp;</span><span style="background-color: transparent;">the functionality of Word or you use the&nbsp;</span><span style="background: none 0% 0% / auto repeat scroll padding-box border-box transparent; border-color: #777777; border-style: none;">Save template</span><span style="background-color: transparent;">-option of the&nbsp;</span><span style="background-color: transparent;">DocumentsCorePack client in order to publish the template to Dynamics 365.<br /> <br /> </span></p> <p style="text-align: justify;"><span style="text-align: justify;"><strong><span style="color: #0077b3;">Step 5: Test your template</span></strong><br /> <span style="background: none 0% 0% / auto repeat scroll padding-box border-box transparent; border-color: #777777; border-style: none;"><span style="background-color: transparent;">As you have made changes to your template you might want to test them quickly.&nbsp;</span><span style="background-color: transparent;">A step by step description of how to test your template can be found <a href="http://www.mscrm-addons.com/Blog/PostId/9872/How%20to%20test%20a%20DocumentsCorePack%20template%20(CRM%202015)">here</a>. Below you can see the result of your created template containing the condition we set, highlighted in yellow.&nbsp;</span></span><br /> </span></p> <p style="text-align: justify;"> <div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}" style="text-align: justify;"><a title="Result of your condition field " href="http://www.mscrm-addons.com/Portals/0/Blog/Insert_Condition_Fields/Figure6_Result.png"><img alt="Result of your condition field " class="img-responsive" src="http://www.mscrm-addons.com/Portals/0/Blog/Insert_Condition_Fields/Figure6_Result.png" width="358" height="170,5" /></a></div> <div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}" style="text-align: justify;">Figure 6: Result of your condition field&nbsp;</div> </p> <p class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}" style="text-align: justify;">​</p> <p style="text-align: justify;"><span style="font-size: 13px;">​<span style="background-color: #fcfcfc;"><strong>That&rsquo;s it!</strong>&nbsp;</span><span style="background-color: #fcfcfc;">We appreciate your feedback! Please share your thoughts by sending an email to&nbsp;</span><a href="mailto:support@mscrm-addons.com" style="background-color: #fcfcfc;">support@mscrm-addons.com</a><span style="background-color: #fcfcfc;">.</span></span></p> <p style="text-align: justify;">&nbsp;</p> <p style="text-align: justify;">​</p> <p style="text-align: justify;">​</p>10092