web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

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,093 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans