General Journal in AX2012 through X++

Hi All,

I create general journal in ax2012 through x++.it created successfully but in Lines voucher is created but account is insert with out dimension values, offset account is not inserted.but i pass the both accounts with dimension values.

how can i insert accounts with dimensions.

here is my code

AxLedgerJournalTable axLedgerJournalTable ;

AxLedgerJournalTrans axLedgerJournalTrans;

container accPattern;

container offSetPattern;

container dimPattern1;

ledgerJournalCheckPost ledgerJournalCheckPost;

;

axLedgerJournalTable = new AxLedgerJournalTable();

axLedgerJournalTrans = new AxLedgerJournalTrans();

//dimPattern1 = [‘OU_3566’,“00000024”, “Training”];

// axLedgerJournalTable.parmDefaultDimension(AxdDimensionUtil::getDimensionAttributeValueSetId(dimPattern1));

axLedgerJournalTable.parmJournalName(“GenJrn”);

axLedgerJournalTable.save();

axLedgerJournalTrans.parmJournalNum(axLedgerJournalTable.ledgerJournalTable().JournalNum);

axLedgerJournalTrans.parmTransDate(systemDateGet());

axLedgerJournalTrans.parmAmountCurCredit(300);

axLedgerJournalTrans.parmAccountType(LedgerJournalACType::Ledger);

accPattern = [‘110110-001-022’,‘110110’,‘0’,‘022’,‘001’,‘0’];

axLedgerJournalTrans.parmLedgerDimension(AxdDimensionUtil::getLedgerAccountId(accPattern));

offSetPattern = [‘110150-001-022’,‘110150’,‘0’,‘022’,‘001’,‘0’];

axLedgerJournalTrans.parmOffsetAccountType(LedgerJournalACType:: Ledger );

axLedgerJournalTrans.parmOffsetLedgerDimension(AxdDimensionUtil::getLedgerAccountId( offSetPattern));

axLedgerJournalTrans.save();

Regards

MSDAX.

Please give me some help