Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Why does AX 2012 data import from staging to target always overwrite 1 record?

Posted on by 2,145

I have a custom table that I am trying to import data into. When importing into my staging table, I get 3 separate records. When importing from staging to target, it will create 1 record (if there are no records) and then 'update' that record twice. If there is already a record in the target, it will update that record 3 times.

I'm fairly certain this has something to do with this table(target) being a custom table, however, I can't figure out why the records always update. They are unique records.

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Why does AX 2012 data import from staging to target always overwrite 1 record?

    Thanks André! the relation between DMF staging table and target table solved my problem :)

  • bRadlyJames Profile Picture
    bRadlyJames 2,145 on at
    RE: Why does AX 2012 data import from staging to target always overwrite 1 record?

    Thank you Andre!  It was the relationship between the staging and target tables that I was missing.  Thank you!!

  • Erik Paulsson Profile Picture
    Erik Paulsson 40 on at
    RE: Why does AX 2012 data import from staging to target always overwrite 1 record?

    Like Andre says, it seems like DMF has trouble finding the specific records you are trying to insert/update. The result is that the first record in the target table is always found.

    DMF uses the relations on the staging table to find records, if the exist. It does this by building a query in code with the DMFStaging table as base and then adds the related table using the relation. If the related record can not be found you will get an insert and if it can be found you will get an update. But if there is no relation at all, the first record of the target table will be found every time and this seems to be your problem.

  • Verified answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,188 Super User 2024 Season 2 on at
    RE: Why does AX 2012 data import from staging to target always overwrite 1 record?

    Hi Bradly,

    You have to ensure your DMFstaging table has a primary index including the fields DefinitionId, ExecutionId and the primary key of the target table.

    Also check if the DMF staging table has a relation with the target table on your primary field. This might be your problem.

    Check e.g. the relations on an existing DMF staging table.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,188 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,030 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans