971-270-0003 info@singlecoilinc.com

Quickly regenerate Default Data Import Export Framework (DIXF) Target Entity Mapping in Microsoft Dynamics AX 2012

As I have been heavily involved at a Customer’s Data Migration the last few months, I have become intimately familiar with the new Microsoft Dynamics AX 2012 Data Import Export Framework (DIXF), formerly known as the Data Migration Framework (DMF). While it is not a perfect tool, it has been tremendously helpful in migrating data and I highly recommend anyone working through data migration into AX 2012 to fully take advantage of the DIXF.

Today I want to talk about a quick way to regenerate all Target Mapping to the default AX values.

Out of the box the only possible way to regenerate the Target Mappings is to navigate to
Data import export framework –> Setup –> Target Entities

DMFSetup

Select a Specific Entity –> Modify Target Mapping

DMFModifyTargetMapping

Mapping Details –> Generate Mapping

this can get very time consuming for all the (to date) 147 entities, not to mention any custom entities created.  Also, sometimes it is not possible to regenerate the target mapping for a particular entity as clicking on “Modify target mapping” generates an error.   This error typically reads along the lines of “Duplicate assignment found for the following target field <some field name>”

DMFDuplicateAssignment

A way to get around this is via an X++ job that generates all the entity associations using a built in method of the DMFTargetXMLToEntityMap table.

Below is a quick and simple job that deletes the complete mapping and regenerates them based on the dynamic association in AX.  The job can be modified to also work for only specific entities by including a where clause.

Regenerate All DMF Target Mapping

static void regenerateDMFTargetMapping(Args _args)
{
    DMFTargetXMLToEntityMap     dmfTargetXMLToEntityMap;
    DMFEntity                   dmfEntity;

    // delete all target Mappings
    ttsBegin;
        delete_from dmfTargetXMLToEntityMap;
    ttsCommit;

    // Regenerate Target Mapping for all Entities
    while select dmfEntity
    {
        DMFTargetXMLToEntityMap::generateMapping(dmfEntity);
    }

    info("All Done!");
}

Regenerate Specific Target Mapping

static void regenerateDMFTargetMapping(Args _args)
{
    DMFTargetXMLToEntityMap     dmfTargetXMLToEntityMap;
    DMFEntity                   dmfEntity;

    // delete specified target Mapping
    ttsBegin;
        delete_from dmfTargetXMLToEntityMap where dmfTargetXMLToEntityMap.Entity = <EntityName>;
    ttsCommit;

    // Regenerate Target Mapping for specified Entity
    while select dmfEntity where dmfEntity.EntityName = <EntityName>
    {
        DMFTargetXMLToEntityMap::generateMapping(dmfEntity);
    }

    info("All Done!");
}

That’s it for today’s post, hope this helps in your Microsoft Dynamics AX 2012 Data Migration efforts!

Submit a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>