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 :
Dynamics 365 Community / Forums / Finance forum / Create Voucher for Led...
Finance forum

Create Voucher for Ledger Journal with X++

(2) ShareShare
ReportReport
Posted on by 10

Hi All.....

Create Voucher for Ledger Journal with X++ @ Data Entity level

               select * from _LedgerJournalTable where _LedgerJournalTable.JournalNum == this.JournalBatchNumber;
                _LedgerJournalTrans.clear();
                _LedgerJournalTrans.initFromLedgerJournalTable_LT(_LedgerJournalTable);
                select firstOnly numSeqTable
                where numSeqTable.RecId == LedgerJournalName::find(vendParams.JournalName).NumberSequenceTable;
                    if (numSeqTable && !voucher)
                    {
                        numberseq = numberseq::newGetVoucherFromCode(numSeqTable.NumberSequence);
                        voucher = numberseq.voucher();
                        this.Voucher = voucher;
                    }

  • Blue Wang Profile Picture
    Microsoft Employee on at

    Hi Sir,

    What problems did you have? please share it,thanks.

  • Venkatesh_M Profile Picture
    10 on at

    You can also use LedgerJournalTrans.defaultrow() which will assign the voucher along with other default values

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans