Friday, November 27, 2015

axLedgerJournalTrans.parmOffsetLedgerDimension is not working in Dynamics AX2012 R3


if you try to create general journal in AX 2012 R3 and the offset Account not set and you are using such of following code


journalTrans.parmOffsetAccountType(LedgerJournalACType:: Ledger ); 
offSetAcctPattern = ["41010101-01-02","41010101", 2, "Region","01","Branch", "02"]; 
journalTrans.parmOffsetLedgerDimension(AxdDimensionUtil::getLedgerAccountId(offSetAcctPattern)); 
journalTrans.save(); 



Solution is simply:
Reverse the code order to be 


offSetAcctPattern = ["41010101-01-02","41010101", 2, "Region","01","Branch", "02"]; 
journalTrans.parmOffsetLedgerDimension(AxdDimensionUtil::getLedgerAccountId(offSetAcctPattern)); 
journalTrans.parmOffsetAccountType(LedgerJournalACType:: Ledger ); 
journalTrans.save(); 







No comments:

Post a Comment