Dear Experts,
I want to ask some question about getting main account from ledger dimension with LedgerJournalACType::Bank. here's the explanation.
i have write some code that can get main account from ledger dimension.
if (ledgerJournalTrans.OffsetAccountType == LedgerJournalACType::Ledger) { info(strFmt('Ledger Dimension : %1', DimensionStorage::GetMainAccountFromLedgerDimension(ledgerJournalTrans.OffsetLedgerDimension).Name;
info(strFmt('Name : %1', DimensionAttributeValueCombination::find(ledgerJournalTrans.OffsetLedgerDimension).DisplayValue)); }
with the code above, i can get the main account alongside with the financial dimension. but, if i want to get the main account from ledger dimension with LedgerJournalACType::Bank, it's not showing any result.
if (ledgerJournalTrans.OffsetAccountType == LedgerJournalACType::Bank) { info(strFmt('Ledger Dimension : %1', DimensionStorage::GetMainAccountFromLedgerDimension(ledgerJournalTrans.OffsetLedgerDimension).Name;
info(strFmt('Name : %1', DimensionAttributeValueCombination::find(ledgerJournalTrans.OffsetLedgerDimension).DisplayValue)); }
can someone suggest me what i can try o solve this problem?
i appreciate any kind of answer.
Regards,
Chaidir Ali Assegaf
*This post is locked for comments
I have the same question (0)Hi Chaidir,
You can use below code for Bank ledger type to get the Bank account
if (ledgerJournalTrans.OffsetAccountType == LedgerJournalACType::Bank) { info(strFmt('Name : %1', DimensionAttributeValueCombination::getDisplayValue(ledgerJournalTrans.OffsetLedgerDimension))); }
This will give you bank account then you can use Bank Account table to get the bank complete name.
Regards,
Ali Zeeshan