SlideShare uma empresa Scribd logo
1 de 1
Dynamics AX 2012 - X++ code to create General Journal
static void Demo_CreateGLJournal(Args _args)
{
   AxLedgerJournalTablejournalTable;
   AxLedgerJournalTransjournalTrans;
   container      accEntryPattern;
   container      offSetEntryPattern;
   ;

    journalTable = new AxLedgerJournalTable();
    journalTrans = new AxLedgerJournalTrans();

    //Journal Name
    journalTable.parmJournalName("GenJrn");
    journalTable.save();

    journalTrans.parmJournalNum(journalTable.ledgerJournalTable().JournalNum);
    journalTrans.parmTransDate(systemDateGet());
    journalTrans.parmAccountType(LedgerJournalACType::Ledger);

    //LedgerDimension =>Ledgeraccount, DAX 2009
    accEntryPattern = ["601501", "601501", 0];
    journalTrans.parmLedgerDimension(AxdDimensionUtil::getLedgerAccountId(accEntryPattern));

    journalTrans.parmAmountCurDebit(2000);

   //OffsetLedgerDimension =>OffsetLedgerAccount, DAX 2009
   offSetEntryPattern = ["401100", "401100", 0];
   journalTrans.parmOffsetAccountType(LedgerJournalACType:: Ledger );
   journalTrans.parmOffsetLedgerDimension(AxdDimensionUtil::getLedgerAccountId(
offSetEntryPattern));

    journalTrans.save();

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

How to post with Financial dimensions:

Format :
["DisplayValue", "MainAccount", NumberOfDimensions, "DimensionName", "DimensionValue"];

E.g:
accEntryPattern = ["601501-Test", "601501", 1, "Department", "OU_1"]

Enjoy exploring 2012 :)

Mais conteúdo relacionado

Mais de Ahmed Farag

Developing ssrs-reports-for-dynamics-ax-120402001948-phpapp01
Developing ssrs-reports-for-dynamics-ax-120402001948-phpapp01Developing ssrs-reports-for-dynamics-ax-120402001948-phpapp01
Developing ssrs-reports-for-dynamics-ax-120402001948-phpapp01Ahmed Farag
 
Dynamics ax 2012 workflow development
Dynamics ax 2012 workflow development Dynamics ax 2012 workflow development
Dynamics ax 2012 workflow development Ahmed Farag
 
93016175 ax2012-enus-rep-02
93016175 ax2012-enus-rep-0293016175 ax2012-enus-rep-02
93016175 ax2012-enus-rep-02Ahmed Farag
 
Call report from x++
Call report from x++Call report from x++
Call report from x++Ahmed Farag
 
Data structures and algorisms
Data structures and algorismsData structures and algorisms
Data structures and algorismsAhmed Farag
 
Retail store connect technical reference
Retail store connect technical referenceRetail store connect technical reference
Retail store connect technical referenceAhmed Farag
 
Retail pos technical reference
Retail pos technical referenceRetail pos technical reference
Retail pos technical referenceAhmed Farag
 

Mais de Ahmed Farag (10)

Developing ssrs-reports-for-dynamics-ax-120402001948-phpapp01
Developing ssrs-reports-for-dynamics-ax-120402001948-phpapp01Developing ssrs-reports-for-dynamics-ax-120402001948-phpapp01
Developing ssrs-reports-for-dynamics-ax-120402001948-phpapp01
 
Dynamics ax 2012 workflow development
Dynamics ax 2012 workflow development Dynamics ax 2012 workflow development
Dynamics ax 2012 workflow development
 
93016175 ax2012-enus-rep-02
93016175 ax2012-enus-rep-0293016175 ax2012-enus-rep-02
93016175 ax2012-enus-rep-02
 
Send email
Send emailSend email
Send email
 
Number seq
Number seqNumber seq
Number seq
 
Call report from x++
Call report from x++Call report from x++
Call report from x++
 
Data structures and algorisms
Data structures and algorismsData structures and algorisms
Data structures and algorisms
 
Morph xit
Morph xitMorph xit
Morph xit
 
Retail store connect technical reference
Retail store connect technical referenceRetail store connect technical reference
Retail store connect technical reference
 
Retail pos technical reference
Retail pos technical referenceRetail pos technical reference
Retail pos technical reference
 

Dynamics ax 2012 x++ code to create general journal

  • 1. Dynamics AX 2012 - X++ code to create General Journal static void Demo_CreateGLJournal(Args _args) { AxLedgerJournalTablejournalTable; AxLedgerJournalTransjournalTrans; container accEntryPattern; container offSetEntryPattern; ; journalTable = new AxLedgerJournalTable(); journalTrans = new AxLedgerJournalTrans(); //Journal Name journalTable.parmJournalName("GenJrn"); journalTable.save(); journalTrans.parmJournalNum(journalTable.ledgerJournalTable().JournalNum); journalTrans.parmTransDate(systemDateGet()); journalTrans.parmAccountType(LedgerJournalACType::Ledger); //LedgerDimension =>Ledgeraccount, DAX 2009 accEntryPattern = ["601501", "601501", 0]; journalTrans.parmLedgerDimension(AxdDimensionUtil::getLedgerAccountId(accEntryPattern)); journalTrans.parmAmountCurDebit(2000); //OffsetLedgerDimension =>OffsetLedgerAccount, DAX 2009 offSetEntryPattern = ["401100", "401100", 0]; journalTrans.parmOffsetAccountType(LedgerJournalACType:: Ledger ); journalTrans.parmOffsetLedgerDimension(AxdDimensionUtil::getLedgerAccountId( offSetEntryPattern)); journalTrans.save(); info(strFmt("Journal %1 created", journalTable.ledgerJournalTable().JournalNum)); } How to post with Financial dimensions: Format : ["DisplayValue", "MainAccount", NumberOfDimensions, "DimensionName", "DimensionValue"]; E.g: accEntryPattern = ["601501-Test", "601501", 1, "Department", "OU_1"] Enjoy exploring 2012 :)