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, ...
Suggested Answer

Error while Creating VendorPayment Journal through X++

(0) ShareShare
ReportReport
Posted on by 390

Hi All,

Please help with providing solution to following error while creating VendorPayment journal in AX2012 through X++

pastedimage1576563093509v1.png

I was used the below code to create VendorPayment Journal:

pastedimage1576563209728v2.png

please help with providing solution how to fix this error:

Thanks...

I have the same question (0)
  • Ehab_altammam Profile Picture
    150 on at

    Hello ,

    are you sure the Name of journal is correct " VendPay" .. . sometime a space could make a different ...

    do you sync LedgerJournaName without an issue ?

  • Ramesh Muthyala Profile Picture
    390 on at

    Hi Ehab,

    yes sure that Name of the journal is "VendPay" and there is no issue with sync LedgerJournalName.

    Thanks..

  • Ehab_altammam Profile Picture
    150 on at

    I think you need to debug code to see what exact field ? any customization ?

  • André Arnaud de Calavon Profile Picture
    305,150 Super User 2026 Season 1 on at

    Hi Ramesh,

    First check if there is a customization on the class JournalTableData. If not, it should be related to a field mismatch between the data dictionary and the SQL database. Ensure, the application can be fully compiled (x++ and CIL) without errors. Then perform a database sync.

  • Suggested answer
    nmaenpaa Profile Picture
    101,172 Moderator on at

    You never specify LedgerJournalTable record for your AxLedgerJournalTable class.

    Therefore, in line 12, when you call journalTable.ledgerJournalTable() it returns an empty buffer of type Common, and you get this error.

    You could try passing a valid ledgerJournalTable to the class, using journalTable.currentRecord method.

    But first you need to either create or select existing LedgerJournalTable. I assume you try to do that in your code but it seems it doesn't succeed.

    By the way, why do you use these Ax* classes at all? It would be easier to work directly with table buffers.

  • Ramesh Muthyala Profile Picture
    390 on at

    Hi Nikolaos,

    I was passed Valid LedgerJournalTable to the class below the code:

    public Common currentRecord(Common _ledgerJournalTable = ledgerJournalTable)

    {

       if (!prmisdefault(_ledgerJournalTable))

       {

           super(_ledgerJournalTable);

           ledgerJournalTable = _ledgerJournalTable as LedgerJournalTable;

       }

       else

       {

           super();

       }

       return ledgerJournalTable;

    }

    Below the super():

    public Common currentRecord(Common _common = null)

    {

       if (!prmisDefault(_common))

       {

           currentRecordIsSet = true;

       }

       return _common;

    }

    below the LedgerJournalTable method of AXLedgerJournal Class:

    public LedgerJournalTable ledgerJournalTable(LedgerJournalTable _ledgerJournalTable = ledgerJournalTable)

    {

       if (!prmisdefault(_ledgerJournalTable))

       {

           this.setCurrentRecordFromExternal(_ledgerJournalTable);

       }

       return this.currentRecord();

    }

    Can you please help to fixing the issue..

  • Suggested answer
    nmaenpaa Profile Picture
    101,172 Moderator on at

    I'm sorry but I can't understand your explanation. You need to debug it and find why there is no LedgerJournalTable. 

    Or, forget the Ax classes and try this:

    LedgerJournalTable ledgerJournalTable;
    LedgerJournalTrans ledgerJournalTrans;
    LedgerJournalName ledgerJournalName;
    
    ledgerJournalName = ledgerJornalName::find("VendPay");
    
    ledgerJournalTable.clear();
    ledgerJournalTable.JournalNum = ""; // Add here logic for initializing the journal num from number seqence or it won't work
    ledgerJournalTable.initFromLedgerJournalName(ledgerJournalName);
    ledgerJournalTable.insert();
    
    ledgerJournalTrans.clear();
    ledgerJournalTrans.initFromLedgerJournalTable(ledgerJournalTable);
    ledgerJournalTrans.TransDate = systemDateGet();
    ledgerJournalTrans.CurrencyCode = "USD";
    ledgerJournalTrans.AmountCurDebit = 1200;
    ledgerJournalTrans.LedgerDimension = DimensionStorge::getDynamicAccount("1001", LedgerJournalACType::Vend));
    ledgerJournalTrans.insert();
    
    // Add the second journal line with similar logic
    
    // Finally, run LedgerJournalCheckPost
    

  • Ramesh Muthyala Profile Picture
    390 on at

    Hi Nikoloas,

    Thanks for your replying..

    while using above code below error:  

    LedgerJournaqlName is not a class  error in line 5 and

    " Argument _LedgerJournalNameID" is incompatible with the required type error. in line 9 from above code.

    Thanks...

  • Suggested answer
    nmaenpaa Profile Picture
    101,172 Moderator on at

    Ah, you are right, if you look at LedgerJournalTable.initFromLedgerJournalName you notice that it doesn't want a LedgerJournalName table buffer as a parameter, instead you need to provide the id ("VendPay").

  • Suggested answer
    SouravDam Profile Picture
    11,732 on at

    Hi Ramesh Muthyal,

    Can you please check once and make sure if the Journal type for vendor payment journal is set to Vendor disbursement or not. If something else is selected, then please rectify this and then check if able to create payment journal through X++ this time.

    Below screen shot is taken from D365 for your quick look.

    2185.JPG

    Best regards,
    Sourav Dam

    Kindly mark this thread 'Yes' if this is answered your query which may help other community members in this forum.

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 804

#2
André Arnaud de Calavon Profile Picture

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

#3
Subra Profile Picture

Subra 528

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans