Skip to main content

Notifications

Announcements

No record found.

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...

  • Ramesh Muthyala Profile Picture
    Ramesh Muthyala 390 on at
    RE: Error while Creating VendorPayment Journal through X++

    AOS restarted but still issue same..

  • kvnkk Profile Picture
    kvnkk 800 on at
    RE: Error while Creating VendorPayment Journal through X++

    Restart AOS.. and check.. if possible clear the cache..

  • Ramesh Muthyala Profile Picture
    Ramesh Muthyala 390 on at
    RE: Error while Creating VendorPayment Journal through X++

    Hi KV,

    Can you help me why same code not working for me

    same code has been worked as expected 2 days back, suddenly this error triggering..

    I was done Full CIL also but same issue..

    Thanks..

  • kvnkk Profile Picture
    kvnkk 800 on at
    RE: Error while Creating VendorPayment Journal through X++

    below code working for us with out any issue

    static void VendPaymJournalCreate(Args _args)

    {

       AxLedgerJournalTable journalTable; // class

       AxLedgerJournalTrans journalTrans,journalTrans1; // class

       container acctPattern;

       container offSetAcctPattern;

       LedgerJournalTable ledgerJournalTable; // table

       ledgerJournalCheckPost ledgerJournalCheckPost;// table

       DimensionDynamicAccount     offsetLedgerDim;

       ;

       journalTable = new AxLedgerJournalTable();

       journalTrans = new AxLedgerJournalTrans();

       //Journal Name

       journalTable.parmJournalName("VendPay");

       journalTable.parmJournalType(LedgerJournalType::Payment);

       journalTable.save();

       journalTrans.parmJournalNum(journalTable.ledgerJournalTable().JournalNum);

       journalTrans.parmTransDate(systemDateGet());

       journalTrans.parmCurrencyCode("AED");

       journalTrans.parmAmountCurDebit(100);

       journalTrans.parmAccountType(LedgerJournalACType::Vend);

       journalTrans.parmLedgerDimension(DimensionStorage::getDynamicAccount("1055",LedgerJournalACType::Vend));

       journalTrans.parmApproved(NoYes::Yes);

       journalTrans.parmOffsetAccountType(LedgerJournalACType::Bank);

       journalTrans.clearField(fieldNum(ledgerJournalTrans, offsetLedgerDimension), false);

       journalTrans.parmOffsetLedgerDimension(5637148366);

       journalTrans.parmApproved(NoYes::Yes);

       journalTrans.save();

       ledgerJournalCheckPost = ledgerJournalCheckPost::newLedgerJournalTable(journalTable.ledgerJournalTable(),NoYes::No);

       ledgerJournalCheckPost.run();

       info(strFmt("Journal No. %1.", journalTable.ledgerJournalTable().JournalNum));

    }

  • Ramesh Muthyala Profile Picture
    Ramesh Muthyala 390 on at
    RE: Error while Creating VendorPayment Journal through X++

    Hi KV,

    Already used same code..

    the error is below:

    Error executing code: The field with ID '0' does not exist in table 'LedgerJournalName'.

    Stack trace

    (S)\Classes\JournalTableData\initFromJournalName - line 10

    (S)\Data Dictionary\Tables\LedgerJournalTable\Methods\initFromLedgerJournalName - line 4

    (S)\Data Dictionary\Tables\LedgerJournalTable\Methods\Insert - line 22

    (S)\Classes\xRecord\write

    (C)\Classes\AxInternalBase\write - line 3

    (C)\Classes\AxInternalBase\doSave - line 62

    (C)\Classes\AxInternalBase\save - line 12

    (C)\Jobs\VendPaymJournalCreateNew - line 15

    Thanks..

  • Ramesh Muthyala Profile Picture
    Ramesh Muthyala 390 on at
    RE: Error while Creating VendorPayment Journal through X++

    Hi KVNKK,

    Thanks for reply..

    Please find the below code as requested:

    static void VendPaynew(Args _args)

    {

    LedgerJournalTable ledgerJournalTable;

    LedgerJournalTrans ledgerJournalTrans, ledgerJournalTrans1;

    LedgerJournalName ledgerJournalName;

    AxLedgerJournalTrans ledgerJournalTrans3;

    AxLedgerJournalTable ledgerJournalTable1;

    LedgerJournalCheckPost ledgerJournalCheckPost;

    ;

    //ledgerJournalName = ledgerJornalName::find("VendPay");

        ledgerJournalTable.JournalName = "VendPay";

       ledgerJournalTable1 = new AxLedgerJournalTable();

       //ledgerJournalTable.JournalName = "VendPay";

    ledgerJournalTable1.parmJournalName('VendPay');

    ledgerJournalTable.clear();

    ledgerJournalTable.JournalNum = "1254"; // Add here logic for initializing the journal num from number seqence or it won't work

    //ledgerJournalTable.initFromLedgerJournalName(ledgerJournalName);

    ledgerJournalTable.insert();

    ledgerJournalTrans.clear();

    //ledgerJournalTrans3.initFromLedgerJournalTable(ledgerJournalTable);

    ledgerJournalTrans3.parmJournalNum(ledgerJournalTable1.ledgerJournalTable().JournalNum);

    ledgerJournalTrans.TransDate = systemDateGet();

    ledgerJournalTrans.CurrencyCode = "USD";

    ledgerJournalTrans.AmountCurDebit = 1200;

    //ledgerJournalTrans.LedgerDimension = DimensionStorge::getDynamicAccount("1001", LedgerJournalACType::Vend));

    ledgerJournalTrans.parmLedgerDimension(DimensionStorage::getDynamicAccount("1001", LedgerJournalACType::Vend));

       ledgerJournalTrans.insert();

    ledgerJournalTrans1.clear();

    ledgerJournalTrans3.parmjournalNum(ledgerJournalTable1.ledgerJournalTable().JournalNum);

    ledgerJournalTrans1.TransDate = systemDateGet();

       ledgerJournalTrans1.CurrencyCode = "USD";

       ledgerJournalTrans1.AmountCurCredit = 1300;

       ledgerJournalTrans1.insert();

    ledgerJournalCheckPost = ledgerJournalCheckPost::newLedgerJournalTable(ledgerJournalTable1.ledgerJournalTable(),NoYes::Yes);

    ledgerJournalCheckPost.run();  

    info(strFmt("Journal No. %1.", ledgerJournalTable1.ledgerJournalTable().JournalNum));

    }

  • Ramesh Muthyala Profile Picture
    Ramesh Muthyala 390 on at
    RE: Error while Creating VendorPayment Journal through X++

    Hi Sourav,

    verified and found that Journal type is Vendor disbursement as expected..

    Thanks..

  • kvnkk Profile Picture
    kvnkk 800 on at
    RE: Error while Creating VendorPayment Journal through X++

    Share your XPO..  will check and update you..

  • Ramesh Muthyala Profile Picture
    Ramesh Muthyala 390 on at
    RE: Error while Creating VendorPayment Journal through X++

    Hi Nikolaos,

    Tried with providing  ledgerJournalTable.JournalName = "VendPay";

    still it is not taking the value.

    while inserting the record , the error is below:

    Name of journal is not specified.

    Thanks..

  • Suggested answer
    SouravDam Profile Picture
    SouravDam 11,723 on at
    RE: Error while Creating VendorPayment Journal through X++

    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

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…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 231,307 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans