What is a Ledger Dimension ?
In D365 F&O, a Ledger Dimension is a RecId that points to a combination of financial dimension values stored in the system. When a user selects a ledger account with dimensions (e.g., 110110-CC001-DEPT02), the system stores this combination and assigns it a unique RecId, that's your Ledger Dimension.
The actual dimension values behind this RecId are stored across framework tables, which is why you need a specific query to pull them out.
Here is the complete static method:
How to Use It
Place this method inside a class (e.g., a utility or helper class like DimensionHelper). Then call it from anywhere in your X++ code like this:
RecId ledgerDim = ledgerJournalTrans.LedgerDimension;
str costCenter = DimensionHelper::getLedDimValue(ledgerDim, "CostCenter");
str department = DimensionHelper::getLedDimValue(ledgerDim, "Department");
info(strFmt("Cost Center: %1, Department: %2", costCenter, department));
If you found this helpful, feel free to share it or leave a comment below. Happy coding in D365! 🚀
Comments
Post a Comment