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, ...
Unanswered

Do some logic after any posting in d365fo

(2) ShareShare
ReportReport
Posted on by 341
Hello all,
Hope you are all doing well.
Could you please suggest what is the suitable place using x++ to put code after any posting to the general ledger whether it was from general journal directly or from sub-ledger because i want to integrate to a service to send it every posted transaction in the same time of posting.
Actually im using extension on LedgerJournalPost class which includes a Post method

public static void post(
        Common  _record,
        TableId _tableId,
        NoYes _transferErrors,
        boolean _splitLargeJournal = true,
        boolean _suppressClientMessages = false,
        str _callingFormName = '',
        LedgerJournalEngine _ledgerJournalEngine = null,
        boolean _skipIL_RU = false,
        LedgerJournalCheckPostResults _results_RU = null,
        boolean _progressBarHide = false)
    {
        LedgerJournalPost::postInternal(_record, _tableId, _transferErrors, _splitLargeJournal, _suppressClientMessages, _callingFormName, _ledgerJournalEngine, _skipIL_RU, _results_RU, _progressBarHide, false);
    }

Thanks in advance :)
Categories:
I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    303,139 Super User 2026 Season 1 on at
    Hi,
     
    Sending the transaction at the same time of posting is a bad decision. It can cause performance issues. 
     
    What is the reason for sending all transactions to another service? Why do you want to do this synchronously? Do you need all accounting entries? Please explain the process and the expected number of transactions in your environment. Based on more details, we can try to help you with a recommended approach.
  • Martin Dráb Profile Picture
    238,745 Most Valuable Professional on at
    Also, that LedgerJournalPost::post() was called doesn't mean that anything was posted (e.g. a validation fails) and it's not the only way how to post a journal. Instead, look at delegates in LedgerJournalCheckPost. But you mustn't send a message to an external system from there, because you don't know yet whether the transaction won't be rolled back. Just write a message to a table (this insert will be rolled back too in case of a failure) and introduce another process sending the messages.
     
    An alternative approach is raising a business event and doing the processing outside of F&O (e.g. in Power Automate). Business events handles the transaction and sending for you.
  • CU21010615-0 Profile Picture
    on at
    To capture all General Ledger transactions (both direct journals and sub-ledgers), the most reliable place to insert your code is an onInserted event handler or a Post-handler on the GeneralJournalEntry table. This table is the central hub where all finalized accounting entries are stored regardless of their origin, ensuring your integration triggers for every successful posting e-zpassme com

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

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

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 364

#3
Diego Mancassola Profile Picture

Diego Mancassola 259

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans