Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Temporary Voucher number does not go according to balance

Posted on by 100

Hi All,

I'm having an issue with uploading general journal using X++.

So previously, I developed a form to upload excel which will create general journal. The voucher was filled correctly in connection to balance. But the side effect with this, users encounter a lot of duplicate voucher issue.

So we decided to use the allocate voucher number on posting setup. This setting uses the temporary voucher number sequence in general ledger parameter setup. But when I upload the excel, the voucher series was not filled in connection to balance. Instead it generates one temporary voucher number per journal line. Below is my code when I generate the voucher number:

_numberSeq = NumberSeq::newGetVoucherFromId(_ledgerJournalTable.NumberSequenceTable);
_voucher = _numberSeq.voucher();
_axJournalTrans.parmVoucher(_voucher);

I have also tried this code:

_numberSeq = NumberSeq::newGetVoucherFromId(_ledgerJournalTable.NumberSequenceTable);
_voucher = new JournalVoucherNum(JournalTableData::newTable(LedgerJournalTable::find(_ledgerJournalTable.JournalNum))).getNew(true);
_axJournalTrans.parmVoucher(_voucher);

Both give the same result. Any idea what went wrong? Thank you!

Regards,

Raymon

*This post is locked for comments

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans