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.
2. Find the entity in the list.
3. Click on the “Modify target mapping” at the top:
4. Click on “Mapping Details”
5. Click on “Generate mapping”
6. Answer “Yes” to prompt
7. You should see your new fields in the list
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>”
“Cannot create a record in Target XML (DMFTargetXML)”
Run the job will fix these issues.
Reblogged this on DYNAMICS AX SOLUTIONS.
Thanks a ton …. Great Post….verifed Solution