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)
Best Practices for Troubleshooting Application Issues in D365 and Power Platform
When facing application issues, it’s important to systematically troubleshoot before reaching out for support. Follow these steps to ensure...

-
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...
-
Introduction The query statement in X++ is a primary method of retrieving and manipulating data in Microsoft Dynamics AX 2012. A query can...
No comments:
Post a Comment