Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

X++ code to create General Journal (The main account 0 does not exist.) , Error found when validating record.

$
0
0

Hello..

I used these article to create general transaction (Header and lines)

https://community.dynamics.com/ax/b/axrajdipdas/archive/2013/04/16/dynamics-ax-2012-x-code-to-create-amp-post-general-Journal

https://community.dynamics.com/365/financeandoperations/b/axsupport/archive/2011/12/21/creating-general-journals-in-ax-2012-in-x

my code

static void Job12(Args _args)
{
    AxLedgerJournalTable header = new AxLedgerJournalTable();

    AxLedgerJournalTrans trans = new AxLedgerJournalTrans();

    container  ledgerDimensions, offsetDimensions;

   
    header.parmJournalName("CSH-001");   
    header.save();  

   
    trans.parmAccountType(LedgerJournalACType::Ledger);   
    trans.parmJournalNum(header.ledgerJournalTable().JournalNum);   
    ledgerDimensions = ["1101010000"];   
    trans.parmLedgerDimension(AxdDimensionUtil::getLedgerAccountId(ledgerDimensions));   
    trans.parmAmountCurDebit(230);   
    offsetDimensions = ["9999999999"];   
    trans.parmOffsetLedgerDimension(AxdDimensionUtil::getLedgerAccountId(offsetDimensions));   
    trans.save();


}


when run the job I got next error 

Any help ..

Thank you in advance.


Viewing all articles
Browse latest Browse all 175888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>