Support for Attachment to from Dynamics 365 Sales (read or write)

By Andreea Arseni, Data Integration Consultant - February 24, 2024

We are pleased to inform you that we support the transfer of attachments to from Dynamics 365 Sales - both read and write.

So, if you have Microsoft Dynamics 365 Sales and would like to transfer attachments to and from those CRM systems to your MS Dynamics 365 ERP, such as Business Central, we've got you covered. 

For example, you can configure MyRapidi to transfer attachments from Microsoft Dynamics 365 Sales to Business Central. The attachments can be transferred in both directions.

Or if you would like to transfer attachments from MS Dynamics Sales to Salesforce Rapidi can do this as well.

WHAT CAN YOU USE THIS FOR?

Transferring attachments like images and PDF files to/from Microsoft Dynamics 365 Sales gives you several benefits. This integration streamlines business processes, enhances data accessibility, improves collaboration, and contributes to more effective customer engagement and service. Furthermore, it can lead to significant efficiency gains and better data management across your organisation.

WHAT FORMATS DO WE SUPPORT?

- The attachments content type from MS Dynamics 365 Sales must be stored in a binary format:

  • for documents: .pdf and .doc 
  • for images: .png and .jpeg

- The attachments from Salesforce would need to be stored in a base64 format.

- The attachments from MS Dynamics 365 Business Central must be stored in a stream file format:

  • for documents: .pdf and .doc 
  • for images: .png and .jpeg

Please note: The API V2 tables that are being used to fetch the attachments from Business Central have been available only for Business Central 2020 wave 2 (v17.2) onwards. Older Business Central versions do not have these APIs available anymore and cannot be enabled.

BEFORE THE SETUP IN MYRAPIDI?

Before configuring the attachment transfer to and from Business Central to MS Dynamics 365 Sales, the field $systemId (2000000000, GUID) would need to be published in Business Central (an extension needs to be created) for the table in question.

In order to publish/expose the above field, please read our article about how to create an extension in Business Central / Publish SystemCreatedAt field in Business Central and go through all the steps.

Use case 1: Attachments to from Dynamics 365 Sales and Business Central

Currently, we support PDF file transfers from Microsoft Dynamics 365 Sales to Business Central via Rapidi. This functionality is supported bidirectionally. You can transfer files from and to Microsoft Sales (Sales Hub) to your Business Central instance.

Attachments in MS Dynamics Sales 365 are stored in two different database tables, which are ActivityMimeAttachment (Email Attachment) and Annotation (Notes). If a user uploads a file to a note, the attachment is stored in the Annotation table, and if a user uploads a file to an email, the attachment will be stored in the ActivityMineAttachment table.

The Notes table in MS Dynamics Sales 365 is linked to all tables or entities, such as accounts, leads, opportunities, invoices, orders, etc. On any of the listed tables, the user can upload a file within Notes, which will be displayed as an attachment. 

Attachments in Business Central are stored in a database table called DocumentAttachmentsAPIV2. From that table, you will retrieve any attachment that is linked to any of your accounts or transactions. 

Below we will walk you through how to set up the attachment transfer to from Dynamics 365 Sales to Business Central

A. The Required Steps in order to Transfer attachments from Dynamics 365 Sales to Business Central:

The steps needed to configure your transfer in myrapidi.com and to be able to transfer files successfully are the following: 

1. Set up both connections in myrapidi.com:
  • Microsoft Dynamics 365 Sales - The connection type within Rapidi is called CRM ODATA.
  • Microsoft Dynamics 365 Business Central - The connection type within Rapidi is called MS Dynamics 365 BC (NAV) OData.

Note: If you need all the steps required to set up both connections - check our article on how to set up ODATA connections via Azure AD.

2. Set up a new transfer as follows:

a) General

Fill in all the fields from the General section of the transfer. Make sure that you select the correct Source and Destination Layouts

General Setup for file transfer from Sales to Business Central

image: General section

B) Source Control

Next, go through Source Control and add any source control (e.g when the attachment has been created).

Sourcecontrol: Sales to Business Central file transfer

Quick Tip: Using a timestamp when setting up any data transfer is always recommended.

C: Table Link: add the primary keys/identifiers 

Then, you need to update the Table Link section. Here, you have to add the primary keys/identifiers  you want to use for this transfer. 

Tablelink: Sales to Business Central file transfer

image: Source Control & Table Link

d) Add field list (mapping)

Next step in the setup process is mapping the fields needed to transfer your attachments.

Fieldlistmapping: Sales to Business Central file transfer

image: Field list (mapping) 

Here, you must map the above 4 fields (as seen above). These fields are mandatory and need to be mapped in order to transfer your attachments. Remember that Business Central requires you to include the parentID to which this attachment should be linked. It is also recommended to store this ID in MS Dynamics 365 Sales so you can match the records from both systems. 

The required fields are:

  • ParentID - This is the GUID ID of the Business Central record that this attachment should be linked to. The easiest way is to store the GUID ID of the record in MS Dynamics 365 Sales so you can use it on this transfer. In Business Central, the parent ID of the record would be the systemID (the above mentioned  $systemId). 
  • AttachmentContent - In Business Central, all files are stored in a stream format. And the corresponding field from MS Dynamics 365 Sales is documentbody_binary. 
  • FileName - This would be the name of the attachment that you are transferring to Business Central. The corresponding field name in MS Dynamics 365 is filename.
  • ParentType - the record type from Business Central.

E) Filters Source

The last part of the process is to add filters via Filters Source. This is optional, but it is recommended for testing purposes. 

filterssouce: Sales to Business Central file transfer

image: Filters Source (delimitations)

3. Activate Changes

After you have created the transfer and added all the information, make sure to click on Activate Design (at the top of your transfer page) before running a test. 

Activate_changes: Sales to Business Central file transfer

image: Activate Changes

 

B. The Required Steps to Transfer attachments from Dynamics 365 Business Central To Dynamics 365 Sales

The steps needed to configure your transfer in myrapidi.com and to be able to transfer files successfully are the following:

1. Set up both connections in myrapidi.com:
  • Microsoft Dynamics 365 Sales - The connection type within Rapidi is called MS Dynamics 365 CRM OData.
  • Dynamics 365 Business Central  - The connection type within Rapidi is called MS Dynamics 365 BC (NAV) OData.

Please Note: If you need all the steps required to set up both connections - check our article on how to set up ODATA connections via Azure AD.

2. Create a new transfer in Myrapidi.com as follows:
 
a) General

Fill in all the fields from the General section of the transfer. Make sure that you select the correct Source and Destination Layouts. 

General setup: Business Central to Sales file transfer

image: General section

b) Source Control

Next, go through Source Control and add any source control (e.g when the attachment has been created). 

Sourcecontrol: Business Central to Sales file transfer

image: Source Control 

And as mentioned earlier: Using a timestamp when setting up any data transfer is always recommended.

c) Table Link (Key Fields)

Then, you need to update the Table Link section. Here, you must add the primary keys/identifiers you want to use for this transfer.

TableLink: Business Central to Sales file transfer

image: Table Link


d) Field List (mapping)

Next step in the setup process is mapping the fields needed to transfer your attachments. 

Here, you must map 3 fields (as seen above). Remember that Dynamics 365 Sales requires you to include the object ID to which this attachment should be linked. It is recommended to store this object ID in Dynamics 365 Business Central so you can match the records from both systems. 

The required fields are:

  • File Name - in both systems, this field needs to be available and therefore mapped.
  • Object ID - This ID would need to be stored in Dynamics 365 Business Central so that you can match the records while transferring the attachments. 
  • AttachmentContent/ documentbody_binary - Documentbody_binary/ attachmentContent - the content of the file/attachment that is being transferred. 

Fieldlistmapping: Business Central to Sales file transfer

image: Field List (mapping)  showing 'Edit mode'

E) Filters Source

The last part of the process is to add filters via Filters Source. This is optional, but it is recommended for testing purposes. 

Filterssouce: Business Central to Sales file transfer

image: Filters Source

3. Activate Changes

After you have created the transfer and added all the information, make sure to click on Activate Design (at the top of your transfer page) before running a test.

Activate_changes: Business Central to Sales file transfer

image: Activate Changes

Congratulations you have completed the setup for file tranfer between MS Dynamics 365 Business Central and Sales

Now, after setting everything up lets see how the files will appear in both systems.

 

Example 1: Transfer attachments from MS Dynamics 365 Sales to Business Central

In the below example, a PDF file has been attached to an opportunity in MS Dynamics 365 Sales. 

Pdf attached to Opportunity in Dynamics 365 Sales

image: Pdf attached to Opportunity in Dynamics 365 Sales

In Business Central, the same file will be transferred into Attached Documents (DocumentAttachmentsAPIV2) and will be linked to the Sales Order:

Pdf visible under Attached Documents and linked to a Sales Order in Business Central

image: Pdf visible under Attached Documents and linked to a Sales Order in Business Central


Example 2: PDF file transfer from Business Central to MS Dynamics 365 Sales

In the below example, a PDF file will be transferred from Business Central to MS Dynamics 365 Sales.

Pdf file under Attached Documents and linked to a Sales Order in Business Central

image: Pdf file under Attached Documents and linked to a Sales Order in Business Central

A PDF file has been attached to a Sales Order in Business Central. And the same file has been transferred to MS Dynamics 365 Sales under Notes on the opportunity (as illustrated below).

Pdf file visible under Notes on the Opportunity in Dynamics 365 Sales 

image: Pdf file visible under Notes on the Opportunity in Dynamics 365 Sales 

Use case 2: Attachments to from Dynamics Sales and Salesforce

Currently, we support PDF file transfers from Microsoft Sales to Salesforce via Rapidi. This new functionality is supported bidirectionally. You can transfer files from and to Microsoft Sales (Sales Hub) to your Salesforce instance. Below a walkthrough how to set up the attachment transfer to from Dynamics 365 Sales to Salesforce.

A. Transfer attachments from Dynamics 365 Sales to Salesforce

The example below will explain how to transfer a binary file (.pdf) from an opportunity in Dynamics Sales 365 into the Salesforce opportunity. You can choose any Dynamics 365 Sales table to transfer your attachments to Salesforce. 

Follow the steps needed as describe below to configure your transfer in myrapidi.com and to be able to transfer files successfully:

1. Set up both connections in myrapidi.com:
  • Microsoft Dynamics 365 Sales - The connection type within Rapidi is called MS Dynamics 365 CRM OData
  • Salesforce - The connection type within Rapidi is called Salesforce.com

Note: If you need all the steps required to set up both connections - check our article on how to set up ODATA connections via Azure AD.

2. Set up a new transfer in myrapidi.com as follows:

a) General

Fill in all the fields from the General section of the transfer. Make sure that you select the correct Source and Destination Layouts. 

General setup for file transfer between Salesforce and MS Dynamics 365 Sales

image: General section


b) Source Control

Next, go through Source Control and add any source control  (e.g when the attachment has been created). 

Sourcecontrol: file transfer to from Dynamics 365 Sales and Salesforce

image: Source Control

c) Table link

Then, you need to update the Table Link section. Here you have to add the primary keys/identifiers that you want to use for this transfer. 

Tablelink: file transfer to from Dynamics 365 Sales and Salesforce

image: Table Link

D) Field list (mapping)

The second-last part of the process is mapping the fields needed to transfer your attachments. 

Fieldmapping: file transfer to from Dynamics 365 Sales and Salesforce

image: Field List (mapping) in 'edit mode'

Here, you must map 3 fields (as seen above). Remember that Salesforce requires you to include the Salesforce parent ID that this attachment should be linked to (this would be the Salesforce object ID). It is recommended to store this object ID in Microsoft Sales as well so you can match the records from both systems. 

The required fields:

  • FileName - The name of the attachment that is being transferred.
  • Parent ID - This is the parent ID of the Salesforce object that this attachment will be linked to. It would need to be stored in MS Dynamics 365 Sales in order to match the records correctly. 
  • Body - This would be the content of the attachment that is being transferred.
 
e) Filters source

The last part of the process is to add filters via Filters Source. This is optional but, for testing purposes, it is recommended to use it. 

Filterssouce: file transfer to from Dynamics 365 Sales and Salesforce

image: Filters Source

3. Activate Changes

After you have created the transfer and added all the information, make sure to click on Activate Design ( at the top of your transfer page) before running a test. 

Activate_changes for file transfer to from Dynamics 365 Sales and Salesforce

image: Activate Changes

B. Transfer attachments from Salesforce to Dynamics 365 Sales


1. Set up a new transfer in MyRapidi.com as follows:

a) General

Fill in all the fields from the General section of the transfer. Make sure that you select the correct Source and Destination Layouts. 

General setup for file transfer to from Dynamics 365 Salesforce to Sales

image: General section

b) Source Control

Next, go through Source Control and add a source control field (a DateTime field that can be used to control the attachments that are being transferred from the source system to the destination system). 

Sourcecontrol: file transfer from Salesforce to Dynamics 365 Sales

image: Source Control

Note: It’s always recommended to use a timestamp when setting up any data transfer. 

c) Table Link (Key Fields)

Then, you need to update the Table Link section. Here you have to add the primary keys/identifiers that you want to use for this transfer. 

Table_link:  file transfer from Salesforce to Dynamics 365 Sales

image: Table Link

d) Field List (mapping)

The next part of the process is mapping the fields needed to transfer your attachments. 

Here, you must map 3 fields (as seen below). Remember that Dynamics 365 Sales requires you to include the object ID this attachment should be linked to. It is recommended to store this object ID in Salesforce as well so you can match the records from both systems. 

The required fields are:

  • Name - the name of the file that is being transferred.
  • ObjectID - The GUID ID of the object that the attachment will be linked to. This ID would need to be stored in Salesforce in order to match records correctly. 
  • Body - This would be the content of the attachment that is being transferred. 

Fieldmapping:  file transfer from Salesforce to Dynamics 365 Sales

image: Field List (mapping)

e) Filters Source

The last part of the process is to add filters via Filters Source. This is optional but for testing purposes, it is recommended to use it. 

Filterssouce:  file transfer from Salesforce to Dynamics 365 Sales

image: Filters Source


3. Activate Changes

After you have created the transfer and added all the information, make sure to click on Activate Design  (at the top of your transfer page) before running a test. 

Activate_changes:  file transfer from Salesforce to Dynamics 365 Sales

image: Activate Changes

 

Example of Attachment transfer from MS Dynamics 365 Sales to Salesforce

This is an example of how the attachment is being sent from Microsoft Dynamics 365 Sales to Salesforce. This is the attachment which is linked to the opportunity:

Attachment sent from Dynamics 365 Sales to Salesforce

image: Attachment sent from Dynamics 365 Sales to Salesforce

And, after transferring the attachment, this is how it looks in Salesforce:

In Salesforce, the attachment will be displayed under Notes & Attachments on the Opportunity page.

You will see the attachment title, who created it and when it was created.

Attachments visible in Salesforce

image: Attachments visible in Salesforce

 

I hope you found this article useful and if you have any issues with the setup of your file transfers please contact support for further assistance.

Also, I encourage you to check out this article on how to setup file transfers to and from MS Dynamics 365 Business Central

Last but not least join our Product Updates Webinar to get up to date about the lasted features and improvements on the MyRapidi Data Integation Platform.


If you are new to Rapidi and would like a basics introduction to the data integration platform please join our Webinar: Introduction to MyRapidi.


About the author

Andreea Arseni, Data Integration Consultant

Picture of
Andreea has extensive experience with data and system integration projects. She is customer-oriented, possesses great technical skills and she is able to manage all projects in a professional and timely manner.


SHARE