Skip to main content

Process of Journal Creation in D365fo

 

  • LedgerJournalSetup → Number sequences, posting setup

Key events

  • LedgerJournalTable.initValue()
  • LedgerJournalTable.validateWrite()
  • LedgerJournalTable.insert()

Class framework

  • LedgerJournalCheckPost → Validations & posting
  • LedgerJournalTableType → Controls defaulting & behavior
  • NumberSeq → Number sequence assignment

Extension points

  • LedgerJournalTable.OnValidatingField()
  • LedgerJournalTable.OnModifiedField()
  • class LedgerJournalTableType_Extension

2. Journal Lines Creation

Each journal header contains lines:

Table

  • LedgerJournalTrans → Journal lines
  • LedgerDimensionAccount → Ledger dimension
  • DimensionAttributeValueCombination → Segment combination
  • CustTable / VendTable / LedgerTable (based on account type)

Key technical operations

  • When user selects account:
    • Combination built by DimensionEntry engine
    • Validated via DimensionValidation framework

Methods involved

  • LedgerJournalTrans.initFromLedgerJournalTable()
  • LedgerJournalTrans.initValue()
  • LedgerJournalTrans.validateWrite()
  • LedgerJournalTrans.validateAccount()
  • LedgerJournalCalcTransAmount (calculates debit/credit)

Class framework

  • LedgerJournalEngine
  • LedgerJournalTransType — determines behavior of line
  • LedgerVoucher (voucher assignment)

3. Journal Validation (Simulate / Check)

User clicks Validate button.

Class

  • LedgerJournalCheckPost (core class for validation AND posting)

Main methods

  • LedgerJournalCheckPost.validate()
  • LedgerJournalCheckPost.validateJournal()
  • LedgerJournalCheckPost.validateLine()

Validation rules

  • Debit = Credit
  • Financial dimensions are required
  • Posting profile rules (for vendor/customer)
  • Inventory availability (for inventory journals)
  • Fixed asset rules (for FA journals)

4. Workflow Submission (if enabled)

📌 Applicable when journal approval workflow is turned on.

Tables

  • WorkflowTable
  • WorkflowWorkItemTable
  • WorkflowTrackingStatusTable

Methods

  • canSubmitToWorkflow() event
  • submitToWorkflow()
  • WorkflowWorkItemActionManager

Events to extend

  • LedgerJournalTable.onCanSubmitToWorkflow()
  • LedgerJournalTable.onSubmitting()

5. Journal Posting

User clicks Post or Post & transfer.

Main class

  • LedgerJournalCheckPost
    • Both validation and posting are handled here.

Key methods

  • run()
  • runAsynchronously()
  • update()
  • initParmDefault()

Posting logic flow

  1. Loop LedgerJournalTrans lines
  2. Validate each line
  3. Create Subledger Journal (temporary)
  4. Pass entries to LedgerVoucher
  5. Post to GeneralJournalAccountEntry & GeneralJournalEntry
  6. Update balances, subledger entries, settlements

6. Accounting / Ledger Impact

This is handled by the Subledger journal framework.

Tables

  • SubledgerJournalAccountEntry (DETAILED posting record)
  • SubledgerVoucher
  • GeneralJournalAccountEntry (GL entry)
  • GeneralJournalEntry (header)

Classes

  • LedgerVoucher
  • LedgerPosting
  • LedgerDimensionFacade

7. Special Journal Types (Short Technical Notes)


A. Vendor Payment Journal

Extra tables:

  • VendTrans (settlement)
  • VendSettlement
  • BankTrans

Class extensions:

  • VendVoucher
  • VendPaymJournalPost

B. Customer Payment Journal

Extra:

  • CustTrans
  • CustSettlement

Classes:

  • CustVoucher
  • CustPaymJournalPost

C. Inventory Journals

Tables:

  • InventJournalTable
  • InventJournalTrans
  • InventTrans (inventory transactions)

Classes:

  • InventJournalCheckPost
  • InventMov_* classes (movement posting)

D. Fixed Asset Journals

Tables:

  • AssetLedger tables*
  • AssetsTable

Classes:

  • AssetPost
  • AssetLedgerJournalCheckPost

8. Journal Reversal

User clicks Reverse transaction or Reverse journal.

Class

  • LedgerJournalReversal

Method

  • reverseVoucher()
  • Creates a new journal with opposite amounts

 


Comments

Popular posts from this blog

Top 200 Q&A in D365FO Technical

  SECTION 1 — X++ BASICS (10 Q&A) 1. What is X++? A proprietary object-oriented language used in Dynamics 365 Finance & Operations for business logic, similar to C# but integrated with D365 runtime. 2. What is a TableBuffer? It is an in-memory object referencing a table. Example: CustTable custTable; 3. What is difference between select and select firstonly ? select → returns all matching rows firstonly → returns only the first matched row 4. What is ttsbegin & ttscommit ? Used to wrap database transactions; ensures atomicity. 5. Can we write SQL queries directly in X++? No. X++ uses a database-abstracted select statement. 6. What is a container? A collection datatype used to store mixed data types. 7. Difference between container and map? Map stores key-value pairs; container is indexed and immutable. 8. What is a temp table? A table that stores data temporarily in memory or database depending on property. 9. What is recursion in X++? A method c...

Process of Sales order in Technical terms in D365Fo

 🔥 Sales Order Technical Flow in D365FO (Creation → Confirmation → Picking → Packing Slip → Invoice → Accounting) 1. Sales Order Creation Tables SalesTable → SO header SalesLine → SO lines CustTable → Customer master InventDim / InventDimCombination → Dimensions InventTable / EcoResProduct → Item master Framework Classes SalesTableType / SalesLineType Responsible for validation, defaulting, creation logic Key Methods SalesTable.initValue() SalesLine.initFromSalesTable() SalesTable.validateWrite() SalesLine.validateWrite() Events (Extensions) SalesTableType.createSalesTable() SalesLineType.createSalesLine() 2. Reservation (Optional) If reservation is done: Tables InventTrans (Reservation status) InventReservation Classes InventUpd_Reservation InventTransReservation Reservations impact picking and inventory availability. 3. Sales Order Confirmation Confirms order and freezes price/quantity. Posti...

Process of Purchase order in Technical terms in D365Fo

  Purchase Order Technical Flow in D365FO (Step-by-Step) (From creation → approval workflow → posting → product receipt → invoice → accounting) 1. Purchase Order Creation Tables involved PurchTable → PO header PurchLine → PO lines VendTable → Vendor master InventDim / InventDimCombination → Item dimensions EcoResProduct / InventTable → Item master Classes / Framework PurchTableType / PurchLineType Framework that controls creation, validation, defaulting. Key methods PurchTable.initValue() PurchLine.initFromPurchTable() PurchTable.validateWrite() PurchLine.validateWrite() Events (Extension points) PurchTableType.createPurchTable() PurchLineType.createPurchLine() 2. Purchase Order Confirmation Document Status update PurchTable.DocumentState → Confirmation PurchParmBuffer tables used for versioning. Posting Class PurchFormLetter_Confirm Called internally via PurchFormLetter::construct(DocumentStatus::Co...