<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/"><channel><atom:link href="https://www.mscrm-addons.com/DesktopModules/LiveBlog/API/Syndication/GetRssFeeds?Tag=fetchxml&amp;mid=2185&amp;PortalId=0&amp;tid=165&amp;ItemCount=20" rel="self" type="application/rss+xml" /><title>News.mscrm-addons.com Blog</title><description>Hello 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! </description><link>https://www.mscrm-addons.com/Blog</link><item><title>How to use the CreateMultiPartXML based on FetchXML</title><link>https://www.mscrm-addons.com/Blog/PostId/10043/how-to-use-the-createmultipartxml-based-on-fetch-xml</link><category>DocumentsCorePack (DCP),DCP 2015 / 2016,DCP 365,DocumentsCorePack 2015/2016</category><pubDate>Wed, 27 Sep 2017 10:32:06 GMT</pubDate><description>&lt;p style="text-align: justify;"&gt;This blog article outlines how to create a document for every contact of an account using the&amp;nbsp;&lt;span style="text-align: justify;"&gt;&lt;strong&gt;CreateMultiPartXMLbasedonFetchXML &lt;/strong&gt;step.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align: justify;"&gt;&lt;strong&gt;Please note:&lt;/strong&gt; You have to make sure you first look into the basics of DocumentsCorePack workflow-steps, &lt;g class="gr_ gr_72 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" id="72" data-gr-id="72"&gt;fetchXML&lt;/g&gt; and Dynamics 365 workflows before you start with this. It will make the progress a lot easier.&amp;nbsp;&lt;/p&gt;
&lt;p style="text-align: justify;"&gt;In this case, we want to create a document for every contact of an account. To achieve this we need the CreateMultiPartXMLbasedonFetchXML step.&amp;nbsp;&lt;/p&gt;
&lt;p style="text-align: justify;"&gt;&lt;strong&gt;1)&lt;/strong&gt; Therefore create a new workflow based on&amp;nbsp;&amp;nbsp;Account. Go to &lt;span style="font-size: 24px; color: #4f81bd;"&gt;❶&amp;nbsp;&lt;/span&gt;DCPWorkflowSandbox and&amp;nbsp;select&amp;nbsp;&lt;span style="font-size: 24px; color: #4f81bd;"&gt;❷&lt;/span&gt; CreateMultiPartXMLbasedonFetchxml, like you can see below.&amp;nbsp;&lt;/p&gt;
&lt;div class=" data-plugin-options=" style="text-align: justify;"&gt;
&lt;div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;
&lt;a title="Add new workflow step - CreateMultiPartXMLbasedonFetchxml " href="/Portals/0/Blog/How_to_use_CreateMultiPartXML_based_on_Fetch XML/Figure1_Add_Step.png"&gt; &lt;img alt="Add new workflow step - CreateMultiPartXMLbasedonFetchxml" height="207" class="img-responsive" src="/Portals/0/Blog/How_to_use_CreateMultiPartXML_based_on_Fetch XML/Figure1_Add_Step.png" width="415,5" /&gt; &lt;/a&gt;&lt;/div&gt;
&lt;div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;&lt;em&gt;Figure 1: Add new workflow step - CreateMultiPartXMLbasedonFetchxml&lt;br /&gt;
&lt;br /&gt;
&lt;/em&gt;&lt;/div&gt;
&lt;p class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;&lt;em&gt; &lt;/em&gt;&lt;/p&gt;
&lt;p class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;&lt;em&gt; &lt;/em&gt;&lt;/p&gt;
&lt;p class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;&lt;em&gt; &lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="text-align: justify;"&gt;&lt;strong&gt;2)&lt;/strong&gt; Next define the properties of your new workflow step by clicking the [Set Properties]-button, highlighted below.&amp;nbsp;&lt;/p&gt;
&lt;div class=" data-plugin-options=" style="text-align: justify;"&gt;
&lt;div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;&lt;a title="Set Properties for CreateMultiPartXMLbasedonFetchxml " href="/Portals/0/Blog/How_to_use_CreateMultiPartXML_based_on_Fetch XML/Figure2_Set_Properties.png"&gt;&lt;img alt="Set Properties for CreateMultiPartXMLbasedonFetchxml" height="207" class="img-responsive" src="/Portals/0/Blog/How_to_use_CreateMultiPartXML_based_on_Fetch XML/Figure2_Set_Properties.png" width="415,5" /&gt; &lt;/a&gt;&lt;/div&gt;
&lt;div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;&lt;em&gt;Figure 2: Set Properties for CreateMultiPartXMLbasedonFetchxml&lt;/em&gt;&lt;/div&gt;
&lt;p class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;&lt;em&gt;&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;&lt;em&gt;&lt;strong&gt;3) &lt;/strong&gt;In the properties of the&amp;nbsp;&lt;span&gt;CreateMultiPartXMLbasedonFetchxml&lt;/span&gt; step, we add the values displayed below:&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class=" data-plugin-options=" style="text-align: justify;"&gt;
&lt;div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;
&lt;a title="Set custom properties " href="/Portals/0/Blog/How_to_use_CreateMultiPartXML_based_on_Fetch XML/Figure3_Set_custom_Step_Input_Properties.png"&gt; &lt;img alt="Set custom properties" width="520,5" height="251" class="img-responsive" src="/Portals/0/Blog/How_to_use_CreateMultiPartXML_based_on_Fetch XML/Figure3_Set_custom_Step_Input_Properties.png" /&gt; &lt;/a&gt;&lt;/div&gt;
&lt;div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;&lt;em&gt;Figure 3: Set custom properties&lt;/em&gt;&lt;/div&gt;
&lt;p class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;&lt;em&gt;&lt;span style="font-size: 24px; color: #4f81bd;"&gt;❶&amp;nbsp;&lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;strong&gt;Template1: &lt;/strong&gt;Our desired Contact Template&lt;br /&gt;
&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 24px; color: #4f81bd;"&gt;❷&amp;nbsp;&lt;/span&gt;&lt;em&gt;&lt;strong&gt;Entity Record URL Base: &lt;/strong&gt;The Record URL of our main entity Account&amp;nbsp;&lt;br /&gt;
&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 24px; color: #4f81bd;"&gt;❸&amp;nbsp;&lt;/span&gt;&lt;em&gt;&lt;strong&gt;FetchXML: &lt;/strong&gt;The XML we want to execute. (How to build such an XML will&amp;nbsp;be explained later in this article)&lt;br /&gt;
&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 24px; color: #4f81bd;"&gt;❹&amp;nbsp;&lt;/span&gt;&lt;em&gt;&lt;strong&gt;FechtSMLResultField:&lt;/strong&gt; The ID-Field of the returned entities - ContactId in this case&lt;br /&gt;
&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 24px; color: #4f81bd;"&gt;❺&amp;nbsp;&lt;/span&gt;&lt;em&gt;&lt;strong&gt;FetchXMLResultEntity:&lt;/strong&gt; The name of the returned&amp;nbsp;entity (contact in our case)&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt; &lt;strong&gt;4)&lt;/strong&gt; Next, add a second step: Create Record - MSCRM-ADDONS.com AutoMergeWorkingItems.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt; &lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class=" data-plugin-options=" style="text-align: justify;"&gt;
&lt;div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;
&lt;a title="MSCRM-ADDONS.com AutomergeWorkingItem " href="/Portals/0/Blog/How_to_use_CreateMultiPartXML_based_on_Fetch XML/Figure4_AutoMergeWorkingIntems.png"&gt; &lt;img alt="MSCRM-ADDONS.com AutomergeWorkingItem" width="485" height="300,5" class="img-responsive" src="/Portals/0/Blog/How_to_use_CreateMultiPartXML_based_on_Fetch XML/Figure4_AutoMergeWorkingIntems.png" /&gt; &lt;/a&gt;&lt;/div&gt;
&lt;div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;&lt;em&gt;Figure 4: MSCRM-ADDONS.com AutomergeWorkingItem&lt;/em&gt;&lt;em&gt; &lt;/em&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="text-align: justify;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="text-align: justify;"&gt;&lt;strong&gt;5) &lt;/strong&gt;Then define the properties as follows:&lt;/p&gt;
&lt;div class=" data-plugin-options=" style="text-align: justify;"&gt;
&lt;div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;
&lt;a title="Properties for AutoMergeWorkingItems " href="/Portals/0/Blog/How_to_use_CreateMultiPartXML_based_on_Fetch XML/Figure5_AutoMergeWorkingItems_properties.png"&gt; &lt;img alt="Properties for AutoMergeWorkingItems" height="207" class="img-responsive" src="/Portals/0/Blog/How_to_use_CreateMultiPartXML_based_on_Fetch XML/Figure5_AutoMergeWorkingItems_properties.png" width="512,5" /&gt; &lt;/a&gt;&lt;/div&gt;
&lt;div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;&lt;em&gt;Figure 5: Properties for AutoMergeWorkingItems&lt;/em&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="text-align: justify;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}" style="text-align: justify;"&gt;&lt;span style="font-size: 24px; color: #4f81bd;"&gt;❶&lt;/span&gt;&amp;nbsp;&lt;span&gt;&lt;strong&gt;Name:&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;Choose a fitting name&lt;/p&gt;
&lt;p style="text-align: justify;"&gt;&lt;span style="font-size: 24px; color: #4f81bd;"&gt;❷&lt;/span&gt;&amp;nbsp;&lt;span&gt;&lt;strong&gt;AutoMergeAction:&lt;/strong&gt;&amp;nbsp;&lt;/span&gt;Create Document&lt;/p&gt;
&lt;p style="text-align: justify;"&gt;&lt;span style="font-size: 24px; color: #4f81bd;"&gt;❸&amp;nbsp;&lt;/span&gt;&lt;strong&gt;PrimaryRecordURL&lt;/strong&gt;&lt;span&gt;&lt;strong&gt;FetchXML:&lt;/strong&gt;&amp;nbsp;&lt;/span&gt;The Record URL of the primary entity (in our example Account)&lt;/p&gt;
&lt;p style="text-align: justify;"&gt;&lt;span style="font-size: 24px; color: #4f81bd;"&gt;❹&lt;/span&gt;&lt;strong&gt;&amp;nbsp;&lt;span&gt;SaveAs:&lt;/span&gt;&lt;/strong&gt;&amp;nbsp;Your desired output (in this example pdf)&lt;/p&gt;
&lt;p style="text-align: justify;"&gt;&lt;span style="font-size: 24px; color: #4f81bd;"&gt;❺&lt;/span&gt;&lt;strong&gt;&amp;nbsp;&lt;span&gt;MultiDocumentXML:&lt;/span&gt;&lt;/strong&gt;&amp;nbsp;The XML output of the previous step&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&lt;/p&gt;
&lt;h1 style="text-align: justify;"&gt;&lt;span style="font-family: Arial; font-size: 24px; color: #4f81bd;"&gt;How to create the Fetch XML&lt;br /&gt;
&lt;/span&gt;&lt;/h1&gt;
&lt;p style="text-align: justify;"&gt;You can use 3&lt;sup&gt;rd&lt;/sup&gt;&amp;nbsp;party tools like &lt;strong&gt;"XRMToolBox"&lt;/strong&gt; to make the creation of the &lt;strong&gt;FechXML&lt;/strong&gt; easier.&amp;nbsp;&lt;/p&gt;
&lt;div class=" data-plugin-options=" style="text-align: justify;"&gt;
&lt;div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;
&lt;a title="FetchXML " href="/Portals/0/Blog/How_to_use_CreateMultiPartXML_based_on_Fetch XML/Figure6_FetchXML.png"&gt; &lt;img alt="FetchXML" width="485" height="300,5" class="img-responsive" src="/Portals/0/Blog/How_to_use_CreateMultiPartXML_based_on_Fetch XML/Figure6_FetchXML.png" /&gt; &lt;/a&gt;&lt;/div&gt;
&lt;div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;&lt;em&gt;Figure 6: FetchXML&lt;br /&gt;
&lt;br /&gt;
&lt;/em&gt;&lt;em&gt; &lt;/em&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="text-align: justify;"&gt;&lt;strong&gt;1)&lt;/strong&gt; Use the Dynamics 365 Advanced Find to get the base structure of the Fetch XML&amp;nbsp;you want,&amp;nbsp; like you can see below.&amp;nbsp;&lt;span&gt;In this case, we wanted to merge all contacts of a particular Account.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;div class=" data-plugin-options=" style="text-align: justify;"&gt;
&lt;div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;
&lt;a title="Download FetchXML " href="/Portals/0/Blog/How_to_use_CreateMultiPartXML_based_on_Fetch XML/Figure7_Download_FetchXML.png"&gt; &lt;img alt="Download FetchXML" width="485" height="300,5" class="img-responsive" src="/Portals/0/Blog/How_to_use_CreateMultiPartXML_based_on_Fetch XML/Figure7_Download_FetchXML.png" /&gt; &lt;/a&gt;&lt;/div&gt;
&lt;div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;&lt;em&gt;Figure 7: Download FetchXML&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/em&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="text-align: justify;"&gt;&lt;strong&gt;2)&lt;/strong&gt; After building this verifying the result, &lt;strong&gt;download the FetchXML&lt;/strong&gt; and paste it into your XML editor. Adjust the &lt;strong&gt;FetchXML&lt;/strong&gt; so it can be executed correctly and has no syntax errors.&amp;nbsp;&lt;/p&gt;
&lt;div class=" data-plugin-options=" style="text-align: justify;"&gt;
&lt;div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;
&lt;a title=" XML Code - Record URL " href="/Portals/0/Blog/How_to_use_CreateMultiPartXML_based_on_Fetch XML/Figure8_XML.png"&gt; &lt;img alt=" XML Code - Record URL" width="485" height="300,5" class="img-responsive" src="/Portals/0/Blog/How_to_use_CreateMultiPartXML_based_on_Fetch XML/Figure8_XML.png" /&gt; &lt;/a&gt;&lt;/div&gt;
&lt;div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;&lt;em&gt;Figure 8: XML Code - Record URL&lt;br /&gt;
&lt;/em&gt;&lt;/div&gt;
&lt;p class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;&lt;em&gt;&lt;br /&gt;
&lt;/em&gt;&lt;/p&gt;
&lt;p class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;&lt;em&gt; &lt;/em&gt;&lt;em&gt; &lt;/em&gt;&lt;/p&gt;
&lt;p class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;&lt;em&gt; &lt;strong&gt;3) &lt;/strong&gt;Afterwards replace the &lt;strong&gt;Record URL&lt;/strong&gt;, which is the primary record you start from, with the value &lt;strong&gt;QID&lt;/strong&gt;,&amp;nbsp;highlighted in yellow below. This is necessary to make the workflow dynamic.&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;div class=" data-plugin-options="&gt;
&lt;div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;
&lt;a title="XML Code - QID" href="/Portals/0/Blog/How_to_use_CreateMultiPartXML_based_on_Fetch XML/Figure9_Dynamic_Workflow.png"&gt; &lt;img alt="XML Code - QID" width="485" height="300,5" class="img-responsive" src="/Portals/0/Blog/How_to_use_CreateMultiPartXML_based_on_Fetch XML/Figure9_Dynamic_Workflow.png" /&gt; &lt;/a&gt;&lt;/div&gt;
&lt;div class="lightbox" data-plugin-options="{'delegate': 'a', 'type': 'image', 'gallery': {'enabled': false}}"&gt;&lt;em&gt;Figure 9: XML Code - QID&lt;/em&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="text-align: justify;"&gt;4) Then copy the finished XML and paste it into the &lt;strong&gt;CreateMultiPartXMLbasedonFetchXML &lt;/strong&gt;step into the field &lt;strong&gt;FetchXML&lt;/strong&gt;.&lt;/p&gt;
&lt;p style="text-align: justify;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="text-align: justify;"&gt;&lt;span style="font-size: 13px;"&gt; &lt;span style="background-color: #fcfcfc; text-align: justify;"&gt;That&amp;rsquo;s it!&amp;nbsp;We appreciate your feedback! Please share your thoughts by sending an email to&amp;nbsp;&lt;/span&gt;&lt;a href="mailto:support@mscrm-addons.com" style="background-color: #fcfcfc; text-align: justify;"&gt;support@mscrm-addons.com&lt;/a&gt;&lt;span style="background-color: #fcfcfc; text-align: justify;"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align: justify;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="text-align: justify;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;</description><guid isPermaLink="false">10043</guid></item></channel></rss>