Main Account table holds the method findByLedgerDimension, by passing ledgerdimensionRecId will return the MainAccountTable. This method is available in AX 2012 as well.
Monday, 29 January 2018
Finding MainAccountId from LedgerDimension record Id in Dynamics 365 FO.
There is a easy way to find or getting the main account number separated from LedgerDimension (RecId).
public static MainAccount findByLedgerDimension( LedgerDimensionAccount _ledgerDimension, boolean _forupdate = false, ConcurrencyModel _concurrencyModel = ConcurrencyModel::Auto) { MainAccount mainAccount; DimensionAttributeValueCombination ledgerDimension; mainAccount.selectForUpdate(_forupdate); if (_forupdate && _concurrencyModel != ConcurrencyModel::Auto) { mainAccount.concurrencyModel(_concurrencyModel); } // Assumes that the main account is properly denormalized on the ledger dimension to avoid joining to the level value select firstonly * from mainAccount exists join ledgerDimension where ledgerDimension.MainAccount == mainAccount.RecId && ledgerDimension.RecId == _ledgerDimension; return mainAccount; }
Subscribe to:
Post Comments (Atom)
Calculate ledger balance by dimension set in X++ in AX2012/Dynamics 365 FO
There are a variety of ways users can view balances in the general ledger. Some of the most common options are: 1. Trial balance 2. Financia...
-
static void Main ( string [ ] args ) { string customer = " US-004 " ; AxdCustomer foundCustomer = null ; C...
-
Microsoft Dynamics Ax Macros In MorphX macros are not commonly used. A few places make use of macros such as keeping track of the li...
No comments:
Post a Comment