Important NOTE: in example below you’ll see a creation of entity for export of data from AX, you’ll not be able to import data with these kind of entity.

For some scenarios you may need to create a DataEntity that don’t have a natural key (like InventTrans), or worse – tables, which don’t have a unique index at all (like CustTrans). Also, for such types of Entities, you may have a requirement – support of Incremental Push (which is also an issue if your table for DataEntity doesn’t have a natural key);

In order to satisfy these requirements, you need to:

1. Create a Query (CustTransQ) object and as a root data source – you need to specify your table (CustTrans);

DataEntity_Picture1

2. Create a View object (CustTransV) and into Query property – you should specify CustTransQ object, created one step earlier;

3. Normally, by using wizard for creation of DataEntity, you need to select a table, which has a natural key, but for this scenario, you can select ANY table that has natural key (it’s just for the purpose of creation the DataEntity object in AOT – let’s call it MyCustTransEntity). For instance – you can select InventDim table.

4. Make sure, that on this step you uncheck all checkboxes (this means that our newly created DataEntity will not contains any field from InventDim table).

The great force to understand and solve the management challenges

ERP technology can help you integrate your business processes in a better way. Connecting business processes, systems and data gives you the intelligence, acceleration, and adaptability you need to optimize your operations. Microsoft Dynamics 365 is built to adapt to your needs and grow with you, so you can be proactive and respond quickly to any disruption or market change.

DataEntity_Picture3

5. Delete InventDim table from the DataSource of MyCustTransEntity;

6. Drug CustTransV into DataSource of MyCustTransEntity;

DataEntity_Picture4

7. Select those fields from CustTransV that you need to be exported via your DataEntity and drug and drop them into Fields node of MyCustTransEntity. The CustTransV.RecId field must also be placed in Fields node of MyCustTransEntity;

8. When you drug and drop CustTransView.RecId field into Fields node, you need to rename it: let’s say from RecId1 to something like CustTransRecId;

9. Add CustTransRecId field into Entity Index node;

After these operations, you need to build you model with synchronization.

So, at this moment your DataEntity can be user for data Export. In order to use this DataEntity for incremental data export, you need to create a class, which will handle some events of DMFEntityBase class (the DMFEntityBase class is responsible for analysis of DataEntities). So, below you’ll see class, which allows to:

1. Use a Views as a dataSource for your DataEntity

2. Check whether change tracking (CT) is enabled for your DataEntity->View->Query-Table

a. So it will enable/disable CT if you’ll add/delete your DataEntityl;

Copy to Clipboard
Published On: / Categories: Tech article, CRM, ERP /

Upgrade your business strength with Dynamics 365

OntargIT is an official Microsoft partner for the implementation of Dynamics 365 technologies. With our experience in various industries, we will provide an individualized approach and effective solutions that will perfectly meet the needs of your company. Leave a request now, and our team of experts will help you take advantage of all the benefits of Dynamics 365.

Upgrade your business strength with Dynamics 365

OntargIT is an official Microsoft partner for the implementation of Dynamics 365 technologies. With our experience in various industries, we will provide an individualized approach and effective solutions that will perfectly meet the needs of your company. Leave a request now, and our team of experts will help you take advantage of all the benefits of Dynamics 365.