Notifications
Announcements
No record found.
You need to debug the code related to Accounts Payable and Purchase Order posting logic.
Purchase Accrual: This is typically posted when goods or services are received but not yet invoiced. It is part of the accrual accounting process.
Purchase Expenditure Un-Invoiced: This represents expenses incurred but not yet invoiced, often related to purchase orders.
The posting of these transactions is usually handled in the Accounts Payable module, specifically in classes related to vendor invoice posting and purchase order posting. Here are the key areas to focus on:
Vendor Invoice Posting:
Class: VendInvoicePost
VendInvoicePost
Method: run() or postInvoice()
run()
postInvoice()
This class handles the posting of vendor invoices and may include logic for accruals.
Purchase Order Posting:
Class: PurchTable
PurchTable
Method: update() or postInvoice()
update()
This class handles the posting of purchase orders and may include logic for un-invoiced expenditures.
Ledger Posting Framework:
Class: LedgerJournalTrans
LedgerJournalTrans
Method: postJournal()
postJournal()
This class handles the posting of journal entries, including accruals and expenditures.
Follow these steps to locate the code responsible for inserting the entries:
Open Visual Studio and navigate to the classes mentioned above (VendInvoicePost, PurchTable, LedgerJournalTrans).
Set breakpoints in the run(), postInvoice(), or update() methods.
Perform the action that triggers the posting (e.g., post a vendor invoice or purchase order).
The debugger will stop at the breakpoints, allowing you to trace the flow of execution.
Step through the code to identify where the Purchase Accrual and Purchase Expenditure Un-Invoiced entries are created.
Look for methods or logic that create ledger transactions with the posting types Purchase, accrual and Purchase expenditure, un-invoiced.
Purchase, accrual
Purchase expenditure, un-invoiced
The subledger journal entries are often created in the LedgerJournalTrans class or related classes.
Look for methods that handle the creation of voucher transactions.
Here are some specific methods to look for:
Accrual Logic:
Method: createAccrualTrans()
createAccrualTrans()
This method may be responsible for creating accrual entries.
Un-Invoiced Expenditure Logic:
Method: createUninvoicedExpenditure()
createUninvoicedExpenditure()
This method may handle the creation of un-invoiced expenditure entries.
Ledger Posting:
Method: postLedger()
postLedger()
This method posts the transactions to the ledger.
Below is an example of where you might find the logic for creating these entries:
// Example: Purchase Accrual Logic if (purchLine.QtyReceived > 0 && purchLine.Invoiced == false) { // Create accrual entry ledgerJournalTrans.clear(); ledgerJournalTrans.AccountNum = purchLine.VendAccount; ledgerJournalTrans.AmountCur = purchLine.LineAmount; ledgerJournalTrans.PostingType = LedgerPostingType::PurchaseAccrual; ledgerJournalTrans.insert(); } // Example: Un-Invoiced Expenditure Logic if (purchLine.QtyReceived > 0 && purchLine.Invoiced == false) { // Create un-invoiced expenditure entry ledgerJournalTrans.clear(); ledgerJournalTrans.AccountNum = purchLine.VendAccount; ledgerJournalTrans.AmountCur = purchLine.LineAmount; ledgerJournalTrans.PostingType = LedgerPostingType::PurchaseExpenditureUninvoiced; ledgerJournalTrans.insert(); }
Use the Dynamics 365 FO Trace Parser to trace the execution flow and identify the exact methods being called.
Check the Event Log in Visual Studio for any errors or warnings related to the posting process.
Refer to the D365FO Documentation or Microsoft Learn for more details on the posting framework.
The Purchase Accrual and Purchase Expenditure Un-Invoiced entries are likely created in the VendInvoicePost or PurchTable classes, specifically in methods related to posting vendor invoices or purchase orders. By setting breakpoints and tracing the code execution, you should be able to locate the exact logic responsible for these entries.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 664 Most Valuable Professional
André Arnaud de Cal... 522 Super User 2025 Season 2
Sohaib Cheema 303 User Group Leader