lingdanglfw(DAX)

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

Export / Import attachments in Dynamics 365 Finance

Export / Import attachments in Dynamics 365 Finance

Document Management – Storing attachment and notes in D365 FO is a simple and easy go process . More information on configuring Document management is detailed in Microsoft document site.

Microsoft has provided an easy way to restore data from Tier-2 environments to other sandbox environments. But Attachment details are not exported in this case. So it would be a tedious job if the project is handling voluminous data with attachments.

More details on other missing data when exported is given as a screenshot below from the MS site,

Now, coming back to our main topic on how to export / import attachments in D365 FO.

There are many out of box entities in D365 FO to support in the export and import of document – Like CustomerAttachmentsEntity , EcoResDocumentAttachmentEntity etc.

For more entities, search in AOT with the below filter.

I tried using CustomerAttachmentsEntity for exporting the data, but it doesn`t export the field ‘FileContents’ which is needed while importing.

Extending the standard entity and bringing the logic to export FileContents field is not working ,though there are no compilation errors.

So I duplicated this entity and brought the logic for FileContents in POSTLOAD method.

/// /// Entity used to Dual-Write document attachments for the CustomerAttachmentsEntity table. ///
public class AECustomerAttachmentsEntity extends common
{

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/// <summary>
///
/// </summary>
public void postLoad()
{
    super();
 
    if(this.RecId && this.DocumentId!= emptyGuid())
    {
        DocuRefEntity baseEntity;
 
        select firstonly baseEntity where baseEntity.DocumentId == this.DocumentId;
 
        this.FileContents = baseEntity.FileContents;
        this.fieldExternallySet(fieldNum(AECustomerAttachmentsEntity, FileContents), false);
    }
}
}

Build and sync the changes.

Now, let us configure a data project and export this entity as XML format. (any format is supported). On exporting, with the File contents would be exported as Resources folder in export package.

Now, let us see on importing the package in another environment

Upload and add the package which we downloaded in the previous step.

After the successful import, we will be able to see the attachment in the customer record

posted on   lingdanglfw  阅读(1)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2016-02-18 Dynamics AX Hostory
点击右上角即可分享
微信分享提示