Pradeep Verma
Pradeep Verma

Reputation: 46

Dynamics 365: Extending Staging and TargetEntity with Custom Fields

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

Upvotes: 1

Views: 4571

Answers (1)

10p
10p

Reputation: 6706

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))]

Upvotes: 1

Related Questions