Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Creating General Journals in AX7 in X++

(0) ShareShare
ReportReport
Posted on by 1,535

I looking for example how to create general journal in AX7.

In Ax2012 I created general journal with class AxLedgerJournalTable and AxLedgerJournalTrans.

blogs.msdn.microsoft.com/axsupport/2011/12/21/creating-general-journals-in-ax-2012-in-x

How can I do that in Ax7 ?

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Creating General Journals in AX7 in X++

    Check this out: www.linkedin.com/.../simplest-way-create-general-journal-d365-using-code-udoye-samuel

  • VermaMC Profile Picture
    VermaMC 465 on at
    RE: Creating General Journals in AX7 in X++

    Hi Hichem Chekebkeb,

    Thanks for the post.

    I have used your approach. The only challenge I am facing is, My user want to give the account and offset account in display values(for eg: if ledger, mainaccount-dep-costcenter and if vendor, vendacount). So, I am stuck at how to convert those display values to ledger dimension keeping account type into consideration. Please suggest an approach for this.

  • Suggested answer
    Hichem.Chekebkeb Profile Picture
    Hichem.Chekebkeb 3,371 on at
    RE: Creating General Journals in AX7 in X++

    For people having the same request I posted an interesting post about how to generate journal vouchers in AX7. Link: [View:https://community.dynamics.com/ax/b/dynamicsaxthehardway/archive/2017/10/26/how-to-generate-ledger-vouchers-using-dataentities-and-x-in-dynamics-365-for-operations]

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Creating General Journals in AX7 in X++

    Hi Andre,

    I am using JournalTableData and JournaTransData to create new line to existing journal as below however keep getting field Id 0 does not exist on journalTransData.create() method. Can you see I am missing anything in below lines.

           LedgerJournalTrans       jourTrans;

            LedgerJournalTableData   jourTableData;

            LedgerJournalStatic   jourStatic;

            JournalTransData      jourTransData;

            jourTableData = JournalTableData::newTable(_ledgerJournalTable);

            //jourTableData.journalTable(_ledgerJournalTable);

            jourTableData.initFromLedgerJournalTable(_ledgerJournalTable);

            jourTableData.initFromJournalName(LedgerJournalName::find(_ledgerJournalTable.JournalName));

            jourStatic = jourTableData.journalStatic();

            jourTransData = jourStatic.newJournalTransData(jourTrans, jourTableData);

            jourTransData.initFromJournalTable();

            jourTrans.CurrencyCode = _ledgerJournalTrans.CurrencyCode;

            jourTrans.TransDate = _ledgerJournalTrans.TransDate;

            jourTrans.parmLedgerDimension(_ledgerJournalTrans.LedgerDimension);

            jourTrans.Txt = _ledgerJournalTrans.Txt;

            jourTrans.parmOffsetLedgerDimension(_ledgerJournalTrans.OffsetLedgerDimension);

            jourTrans.AmountCurCredit = __ledgerJournalTrans.AmountCurCredit;

            jourTransData.create();

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,391 Super User 2024 Season 2 on at
    RE: Creating General Journals in AX7 in X++

    Hi IKSIKS,

    In addition to ievgen's answer you can also use the classes JournalTableData and JournalTransData to create journals.

  • Verified answer
    Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: Creating General Journals in AX7 in X++

    You can look at MCRLedgerJournal class it creates ledger Journal and lines using "old school" way, operating directly with tables and ledgetJournalEngine.

    Another thing you can look at is LedgerJournal* data entities its a real replacement of Ax classes.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans