Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 143529

AX2012R2 Data import/export framework (aka: DMF) import troubles.

$
0
0

Hi all,

I have some strange behaviour while importing data into a simple custom table while using the Import/Export framework, let me explain:

I've created a simple custom table in ax which holds 1 field and will store categories, the structure of the table is as shown below:

Step1: Create the Custom table

To be sure that each row will hold unique values for the category, i've created an unique index on the table and i've set the index as primary and clusterd index for the table. 

Step2: Create the migration entity:

Next with the entity creation wizard from the import/export data framework, i've created a custom migration entity (which results in creation of a migration logic class, a query and a staging table), as shown below:

Result is a small migration object which holds de staging table, a query to fill the target-entity and a migration-logic class. As we will not do any fancy things here, the code is as-is.

Step3: Create the Target-Entity:

The objects from the wizard are used to compose our target entity. The target entity will be the source for our processing group (as i will explain next ...)

Step4: Create the Processing Group:

In my case, i've created a processinggroup TmpCategoryPG which maps to the TmpCategory target-entity.

The Sample file path is set to a file called CategoryImport.txt , which contents is as mentioned below:

For demo purpose ... very simple, just holding category names going from C01 until C03.

Step 5: Get staging data:

Step6: Copy to target:

Hm ... this should be '3' created '0' updated instead of '1" created '2' updated, as my TmpCategory was empty before loading.

Step7: Check import history:

Well ... 3 items were imported, but when I look at the target table, i see that only the last record was inserted. If i look again at the import message, i believe that the import tool first inserted the first row (C1) then updated the first row (C1) with the second (C2) and finally updated the second (C2) with the third (C3).


Somebody any clue here ? --> to summarize : TmpCategory was empty, import datatable holds 3 records C1,C2,C3, the first record is inserted, next the first is updated with the second, next the second is updated with the 3rd, which results in creation of 1 record (C3) instead of 3 records (C1,C2,C3).

Thx for any response :)

Greetz,

Emmanuel Nuyttens


Viewing all articles
Browse latest Browse all 143529

Trending Articles