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 163

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

I have the same question (0)
  • Suggested answer
    Komi Siabi Profile Picture
    13,190 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
    163 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 545 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 408

#3
Adis Profile Picture

Adis 267 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans