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 :
Finance | Project Operations, Human Resources, ...
Answered

Create Ledger Journal by code x++

(0) ShareShare
ReportReport
Posted on by 169

I want to create ledger Journal lines (LedgerJournaltrans table ) .

Question 1 :  I want to make account type = project and put project id in account 

How can I do this ? I can't find how to put project id in account (Ledger Dimension)

Question2 : How Can I add new Voucher (It put automatic when clicking on new button not add by user )

Which Method do this ?

6064.Screenshot-_2800_99_29005F00_LI.jpg

  • Suggested answer
    Komi Siabi Profile Picture
    13,253 Most Valuable Professional on at

    Here, you can specify the main account to be project.

                ledgerjournalTrans.initValue();
                ledgerJournalTrans.AccountType       = LedgerJournalACType::Project;
                ledgerJournalTrans.TransactionType   = LedgerTransType::Project;
                ledgerJournalTrans.LedgerDimension = LedgerDynamicAccountHelper::getDynamicAccountFromAccountNumber(projTable.ProjId,LedgerJournalACType::Project);

    You can get the voucher from the ledgerjournalname

    voucher =  NumberSeq::newGetVoucherFromId((ledgerjournalname.NumberSequenceTable)).voucher();
    ledgerJournalTrans.Voucher = voucher;

  • Menna Allah Ahmed Profile Picture
    169 on at

    Thank you it works well .

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 445 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 309 Super User 2026 Season 2

#3
CU29091230-0 Profile Picture

CU29091230-0 192

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans