• Release History
  • Documentation
  • Back to www.mscrm-addons.com
  • Release History
  • Documentation
  • Back to www.mscrm-addons.com
home/Knowledge Base/DocumentsCorePack(DCP)/Dynamic document elements in Multipart documents

Dynamic document elements in Multipart documents

889 views 0 Updated on March 11, 2025

Dynamic Documents is a feature within the MultiPart capabilities of DocumentsCorePack. It allows users to configure a query and retrieve records you want to generate and add a document for as part of your multipart configuration.  Using this feature would allow one to include documents from other entities in a Multipart outside of the entity the Multipart-OCA itself is configured for.   

Example: In a document package created for an Account, one could also include documents based on the Contact entity. 

To demonstrate this feature, we will be walking through a particular use case as shown below. 

Note: This article assumes a general understanding of the following topics: 

  • Multipart documents 
  • One-Click-Actions (aka OCAs) 
  • Concatenation in DocumentsCorePack 
  • Creating FetchXML (see “How to create the Fetch XML” section) 

Prerequisites 

Before setting up our Multipart, we must enable this feature.  To enable it, a SettingsKey must first be created as follows: 

  • Name: ShowDynamicDocumentsOption 
  • Value: true 
  • Product: AutoMerge 

Additionally, the service and solution must be updated to the following versions:

  • DocumentsCorePack Server 2020.121
  • GlobalButton 2020.168

Our use case 

We want to create a document package for a customer based on an opportunity within our Dataverse environment.  This document package should have the following elements: 

  • a Cover page, 
  • a terms and conditions document 
  • and a document for quotes related to this opportunity we deem relevant to this package.  

Note: We want the user to be able to select the relevant quotes when creating the proposal in the DocumentsCorePack dialog. 

Configuring our Multipart OCA 

Our OCA will be based on the Opportunity entity.  When creating the OCA, ensure that to select “Use Multipart” in the template settings.  We’ll set up our cover page and terms & conditions document as well. 

initial multipart config
Figure 1: Our initial MultiPart configuration

Then, we’ll add another section to our document.  Once added, select Dynamic Documents from the type list. 

selecting dynamic documents
Figure 2: Selecting the “Dynamic Documents” type from the dropdown

When selected, a new window will pop up, called “Multipart Dynamic Documents.”  In this window, you can define the query for records you want to create a document for. First, we define the entity to retrieve records from (1).  On the right, you can set if you want to retrieve the records based on a fetch or based on conditions (2).  For this example, we will select the Quote entity and retrieve our records via fetch. 

selecting entity and view
Figure 3: Selecting our entity and view

We want to retrieve all quotes related to the opportunity we are launching this OCA from.  To do that, we will set the selected view to Use Custom Fetch.  We can then add the following fetch to the textbox:  

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
	<entity name="quote">
		<filter type="and">
			<filter type="and">
				<condition attribute="opportunityid" operator="eq" value="[GUID]"/>
			</filter>
		</filter>
	</entity>
</fetch>

The value “[GUID]” is important here.  When this value is set, the guid of the parent record (in our case, our opportunity record), will be dynamically retrieved when this fetch is executed.  This means that the quotes we retrieve will only be the quotes related to our opportunity record. 

This is what our fetch looks like in the window: 

custom fetch
Figure 4: Adding our custom fetch. Note that the value is set to [GUID].

Once our fetch has been added, we can click ‘OK’ and return to the Multipart.  From there, click into the “Description” textbox of our Dynamic Document row (see Figure 1).  This will open an OCA lookup prompt.  Here, you will need to select an OCA based on the entity we are retrieving records from.  In this case, we will select an OCA based on the quote entity. 

Note: Dynamic Documents only uses the templates defined within the selected OCA. Other settings in the selected OCA, such as document processing and preview settings, are ignored. 

selecting our OCA
Figure 5: Selecting the OCA

With the OCA selected, we can return to the Multipart.  Before saving the Multipart, we will set the Dynamic Documents row to be optional.  This way, users can later choose which quotes they want to include as part of this document package in the DocumentsCorePack Dialog. 

our desired oca
Figure 6: Our desired OCA

Once saved, go to the opportunity you would like to create a document package for and launch the DCP Dialog.   

Launching our OCA 

When launching the OCA we created, you will notice that the related quotes are displayed under the “QUOTES” section, along with the template taken from our “Process Quote” OCA.  Since we set the Dynamic Documents row to be optional, we can choose which quote or quotes we want to include in the document package. 

dialog with dynamic documents
Figure 7: The dialog, showing our configured Dynamic Documents

After proceeding, we obtain our result document package. 

cover page and quote
Figure 8a: The cover page and first quote of our document package
quote and t&c
Figure 8b: A quote and the first page of our T&C

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

Tags:OCAMultipartdynamic documents

Was this helpful?

Yes  No
Related Articles
  • Document Generation via Copilot in Dynamics 365 Sales using DocumentsCorePack
  • DocumentsCorePack: Best practices for Dynamics 365 on-premises to online migration projects
  • Multilingual Support in DocumentsCorePack
  • Configure DocumentsCorePack within custom pages
  • Ensuring correct time zone display for DateTime fields
  • Document Generation Failure from Missing Privileges
Latest Articles
  • Document Generation via Copilot in Dynamics 365 Sales using DocumentsCorePack
  • DocumentsCorePack: Best practices for Dynamics 365 on-premises to online migration projects
  • Multilingual Support in DocumentsCorePack
  • Recap: ColorCloud 2025
  • Configure DocumentsCorePack within custom pages
Popular Articles
  • DocumentsCorePack Template Designer – Getting Started
  • Step-by-Step: How to configure a One-Click-Action
  • Application Access for Dynamics 365
  • How to find your environment’s unique name in Microsoft Dynamics 365
  • How licenses are counted
Top Rated Articles
  • “Undefined”-labels in Chrome and Edge 114 and higher
  • Important information for Dynamics 365 online customers using DocumentsCorePack and/or AttachmentExtractor
  • How to activate the DocumentsCorePack Connector for PowerApps & Microsoft Flow
  • How licenses are counted
  • How to insert Condition Fields in DocumentsCorePack Templates designer
Categories
  • *News and General Infos* 62
  • Webinars 45
  • Template Designer(DCP 196
  • DocumentsCorePack(DCP 251
  • TelephoneIntegration (TI 65
  • AttachmentExtractor (AE 72
  • PowerSearch (PS 50
  • ActivityTools (AT 61
  • SmartBar (SB 54
  • GroupCalendar (GC 47
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.