The business document management, in Dynamics 365 Finance &SCM, is built on top of the ER framework and enables business users to edit business document templates by using Microsoft Office 365 service or appropriate Microsoft Office desktop application.

You can add a new field, either standard or custom, which is not available in an existing business document template without any coding.
In this example I will explain how to add the name of the ordering person of a purchase order to the purchase order template.


Enhance the data model

First you need to add the new field to the data model.
Therefore, create a new data model in the electronic reporting configuration and derive it from the existing data model which is used by the template.
For the purchase order this is the order model.

Click on create configuration and select “Derive from Name…”, enter a new name and description.


You will now have a new data model with a base value “Order model”.



Open the designer on the new data model, you will see in the left pane the data model structure and the details of the selected node on the right side.


We will now add a sub-node of the type string to the node “Order”.

Select the node “Order” and click on new. Enter the name of the new node, in our example “Orderer” and select the data type string.

Click add to finish the step.

Click on save and close the designer.

You need to change the status of the data model from Draft to Complete, for the change to be active and the field to be available.


The new data model will look like this, a new draft version is automatically created.



Create a new data mapping


Select the Configuration Purchase order model mapping (RDP)

Click on “+Create configuration” and select “Derive from name: Purchase order model mapping (RDP), Microsoft.”, enter a name and as target model select your new data model.

Select in the configuration overview your new Mapping node, which is a sub-node of the “Purchase order model mapping (RDP)”

Open the mapping in the designer.

In the right panel you see the data model, select their the new field “Orderer”.


In the middle, the data source panel, open the following path.

Variables > $PurchPurchaseOrderHeader => >Relations => Purchase orders(PurchId) => >Relations => Worker(WorkerPurchPlacer) => name() and click on “Bind”.

Your data model should look like this:


Click on Save and close the designer and go back to the report configuration overview. Select the model mapping node and change the status from draft to complete.


Automatically a new draft will be created and you a new completed version.



Edit template


Select the format configuration named “Purchase order (Excel)”


Open the business document management workspace.

Open the template by clicking on edit.

Enter a template name and click ok.


Click on “Show structure” to enable the available template data structure.


Select the cells I-K16 and select “Merge and Center”.

Select in the structure the node “Document details”.


Click on “+Add” and select Cell.

Enter the name for the cell that will show the label “DocumentDetails_Orderer_Label”.

Click on “OK”.

Now we need to do the same for the cell which will display the value.

Select the cells “L-N16” and select “Merge and Center”.

Select in the structure the node “Document details”.

Click on “+Add” and select Cell.

Enter the name for the cell that will show the label “DocumentDetails_Orderer_Value”.

Click on “OK”.

In your structure you will now have two new values (DocumentDetails_Orderer_Label and DocumentDetails_Orderer_Value).


Click on the 3 dots next to the delete button and select “Show bindings”.

Select the entry DocumentDetails_Orderer_Value in the template structure and in the Data source pane select “Orderer” (Model => $PurchPurchase => Orderer).


Click on bind.

Click on save and close the excel editor.

Select the entry in the Business document management Workspace and click on “Publish”.

When asked:

Click on “Yes”.



Use the template

To use the template, you must configure the print management settings.

Go to “All purchase orders”, select a confirmed purchase order, open the print management settings on the General ribbon.

Select the Purchase order node for the Transaction.

Right-click and select “new”.

Enter on the new node a name and select as Report format value “Demo Purchase Order (Excel)”

Change to the original node and close the settings by pressing escape.

Open the confirmation journals and select under “Preview/Print” the option “Use print management”.


The SSRS report will be displayed and the Excel report will be downloaded.

The Excel file will look like this: