Hello everyone,
How can I get the LedgerDimensionField Values from GeneralJournalAccountEntry table ? I need individual values from that field. Please advice any example.
Thank you.
Hello everyone,
How can I get the LedgerDimensionField Values from GeneralJournalAccountEntry table ? I need individual values from that field. Please advice any example.
Thank you.
No. But below code works. Thank you for your prompt response.
MainAccount::findByLedgerDimension(LedgerDimension).MainAccountId;
Did you do an incremental CIL after changing your code?
Please check below output.
In that case, try this statement -
DimensionStorage::GetMainAccountFromLedgerDimension(generalJournalAccountEntry.LedgerDimension).MainAccountId;
All above methods bring RecId vlaue of the record. Even the DimensionAttributeValueCombination.
getMainAccountFromLedgerDimension method will return the the MainAccount record. getMainAccountNumFromLedgerDimension method should return the MainAccount Id. What values are you getting when you used these methods?
Could you query DimensionAttributeValueCombination table using the same LedgerDimension value and check the value of the MainAccount field?
DimensionAttributeValueCombination dimAttrValueCombo; select firstonly MainAccount from dimAttrValueCombo where dimAttrValueCombo.RecId == generalJournalAccountEntry.LedgerDimension
I try All below methods. Still same. Its not getting MainAccountNum.
getMainAccountFromLedgerDimension
getMainAccountIdFromLedgerDimension
getMainAccountNumFromLedgerDimension
Try this please. Really difficult to find all the methods used in AX 2012
display RecId displayMainAccountid() { return DimensionStorage::GetMainAccountNumFromLedgerDimension(this.LedgerDimension); }
Its Ok to have mistakes . The above method is getting RecId value only not MainAccountNum.
display RecId displayMainAccountid() { return DimensionStorage::GetMainAccountIdFromLedgerDimension(this.LedgerDimension); }
My mistake. This class is used in D365 only and not AX 2012. You can use this statement to get Main account
DimensionStorage::GetMainAccountIdFromLedgerDimension(generalJournalAccountEntry.LedgerDimension)
André Arnaud de Cal... 291,602 Super User 2024 Season 2
Martin Dráb 230,340 Most Valuable Professional
nmaenpaa 101,156