web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Import data using LedgerJournalEntity

(0) ShareShare
ReportReport
Posted on by 451

Hi All,

I have a requirement where I need to populate the terms of payment in genereal journal using LedgerJournalEntity.

I have tried using UpdateEntityDatasource to update the LedgerJournalTrans table directly with the customers terms of payment but this is not getting called along with some more methods.

As this field LedgerJournalTrans.Payment is not a part of entity so I cannot explicitly set its value in postGetStagingData. Can you please suggest how to populate this.

Even extending and adding the field is not helping.

Thanks!

I have the same question (0)
  • Martin Dráb Profile Picture
    239,118 Most Valuable Professional on at

    Which type of journal are you trying to import?

    The field already available in several entities, such as:

    • CustInvoiceJournalLineEntity
    • CustomerPaymentJournalLineEntity
    • ExpenseJournalLineEntity
    • VendInvoiceRegisterLineV2Entity
    • VendorPaymentJournalLineEntity
  • Dev Profile Picture
    451 on at

    I am trying to import general journal.

  • Suggested answer
    Martin Dráb Profile Picture
    239,118 Most Valuable Professional on at

    If it makes sense from business point-of-view (although Microsoft didn't think that), simply add the field to the entity through an extension. There is no need to write any code, either in updateEntityDatasource() or postGetStagingData().

  • Dev Profile Picture
    451 on at

    I have tried that too but the record is not updating.

    I have added a field in extension and mapped that field to LedgerJournalTrans.Payment . In the extension class for LedgerJournalEntity in postGetStagingData I have written  below code to get terms of payment for that customer

    ledgerJournalEntityStaging.TermsOfPayment = custTable.PaymTermId;

    I have regenerated mapping the synchronized everything but this value is not reflecting in new general journal although the customer has this setup.

    There is a method copyCustomStagingToTarget  do we need to make any modification here.

  • Martin Dráb Profile Picture
    239,118 Most Valuable Professional on at

    I thought you wanted to import the value, but now I see you're tryting to populate it from CustTable. Can you clarify what you're trying to achieve, please?

    In either case, postGetStagingData() is a bad place for it. copyCustomStagingToTarget() is not related to any of those requirements either.

  • Dev Profile Picture
    451 on at

    So I have an xml with details of customer and other details for general journal lines that I want to import. When importing I am fetching the terms of payment from the customer mentioned in the xml and trying to populate its value in the general journal. For all the existing fields in the standard entity I am writing logic to modify the values based on our requirement in the postGetStagingData() and they are working fine but for this newly added field in the extension I am unable to get the value although while debugging i can see that at this stage the value is populating in the staging but doesn't make it to the target table.

  • Martin Dráb Profile Picture
    239,118 Most Valuable Professional on at

    I'm confused. You said thay you want to fetch the data from a customer, which means that you don't want to get it from outside. But you're also talking about "a newly added field in extension". If you want to intitialize the value from customer, you don't need any new field in entity extension, do you? You would need that if you wanted to import the value from a file, but then you wouldn't be taken the value from a customer.

    I looked into CDE repository at the implementation of LergerJournalEntity and I see that you're right - the logic there is heavily based on manipulating staging table and using custom copy-to-target logic. It's not usual, but Microsoft did it here for performance reasons.

    I guess that the right place for your logic are methods createJournalLines() and updateExistingJournalLines(), but I'll look at it in more detail on Monday.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 733

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 461 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 278 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans