1

I am trying to Extend the LedgerJournalEntity with new CustomFields

I have added into my project

Solutions Explorer Screenshot:

Solutions Explorer Screenshot

Mapping Details

Mapping Details

All the required Artifacts

I have created an Extension project and added three Fields in LedgerJournalEntityStaging and LedgerJournalTrans I have also regenerated Mapping from TargetEntity Form. I can see my new fields on both staging and Target entity However when i import data from Data Management. Only staging contains the data and Target Fields are not getting populated

Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50
Pradeep Verma
  • 46
  • 1
  • 6
  • Working with AX2012 you would have needed to ["head to the Target Entity and hit Modify target mapping. Switch to the 'Mapping details' view and map the field in the Staging table to your custom Target field."](https://community.dynamics.com/ax/f/33/t/147569). Presumably this step will never be included in your above Project as it's applicable to the [Processing Group](https://ax.help.dynamics.com/en/wiki/data-importexport-framework-user-guide-dixf-dmf/) on the AX Service instance. – ian_scho Mar 24 '17 at 06:55
  • I did perform these steps. I also have a correct mapping from Staging to Target for new custom Fields – Pradeep Verma Mar 24 '17 at 09:20

1 Answers1

1

If you open a list of data entities you will notice that the Set based processing (set based SQL operations) flag has been switched on for LedgerJournalEntity.

When you debug the import process you can see how method copyCustomStagingToTarget in LedgerJournalEntity performs a custom copy from staging to target.

I would suggest you to create an event handler to cater for populating the new fields in LedgerJournalTable and LedgerJournalTrans:

[PostHandlerFor(tableStr(LedgerJournalEntity), tableStaticMethodStr(LedgerJournalEntity, copyCustomStagingToTarget))]
10p
  • 5,488
  • 22
  • 30