Body: I’m on Dynamics 365 Finance & Operations X++. I expose a custom service that creates a General Journal for a specific journal name Payroll. Before/while creating the journal, I want to:
How Read (or safely generate) the Journal batch number (LedgerJournalTable.JournalNum) that will be assigned to the header for journal name Payroll.
How Read (or safely generate) a Voucher number for the journal lines based on the voucher series configured on the same journal name.
I’m looking for short sample.
LedgerJournalName journalName = LedgerJournalName::find(...); LedgerJournalTable journal; journal.initFromLedgerJournalName(journalName.JournalName); journal.JournalNum = JournalTableData::newTable(journal).nextJournalId();
JournalVoucherNum journalVoucherNum = new JournalVoucherNum(JournalTableData::newTable(journal)); LedgerJournalTrans ledgerJournalTrans; ... ledgerJournalTrans.Voucher = journalVoucherNum.getNew(false);
NumberSequenceReference numberSequenceReference = NumberSeqReference::findReference(extendedtypenum(YourEDT)); NumberSeq journalNumberSeq = NumberSeq::newGetNum(numberSequenceReference, false);
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 Andrés Arias as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
CA Neeraj Kumar 895
Sohaib Cheema 811 User Group Leader
André Arnaud de Cal... 787 Super User 2025 Season 2