RSS

DIXF – How to regenerate target entities

26 Aug

There is time when you add custom fields to staging table and they do not appear in your Target when you promote data from STAGING to TARGET. The reason the new fields do not appear in TARGET because it does not know there are new fields that we need to regenerate field mapping for the target.

There are 2 ways to do this, I’m going to show you both LONG WAY and SHORT WAY

LONG WAY

1. Go to the DIXF area page. Click on Target entities.

image

2. Find the entity in the list.

clip_image001[5]

3. Click on the “Modify target mapping” at the top:

image

4. Click on “Mapping Details”

image

5. Click on “Generate mapping”

clip_image001

6.  Answer “Yes” to prompt

image

7. You should see your new fields in the list

clip_image001[13]

SHORT WAY

Run either one of the 2 jobs below

This jobs run for all entities

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!");
}

This one run for  one entity. Make sure to replace your <Entity Name> with your entity

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!");
}

ADVANTAGE OF USING JOBS

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

“Cannot create a record in Target XML (DMFTargetXML)”

image

Run the job will fix these issues.

Advertisements
 
2 Comments

Posted by on August 26, 2014 in Development

 

Tags: , , , , , , ,

2 responses to “DIXF – How to regenerate target entities

  1. Arun Garg

    August 28, 2015 at 5:42 am

    Reblogged this on DYNAMICS AX SOLUTIONS.

     
  2. Kapil arya

    August 14, 2016 at 5:42 pm

    Thanks a ton …. Great Post….verifed Solution

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: