Skip to main content

Notifications

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

  • Menna Allah Ahmed Profile Picture
    Menna Allah Ahmed 163 on at
    RE: Create Ledger Journal by code x++

    Thank you it works well .

  • Verified answer
    Komi Siabi Profile Picture
    Komi Siabi 12,759 Most Valuable Professional on at
    RE: Create Ledger Journal by code x++

    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;

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,074 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,900 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans