15 December 2017

How to get ledger dimension values for active account structure in AX 2012 AX7 D365

public static DimensionValue dimensionDisplayValue(LedgerDimensionAccount _ledgerDimension, Name _dimensionName )
{
DimensionAttributeLevelValueAllView dimAttrView; //View that will display all values for ledger dimensions
DimensionAttribute dimAttr; //Main dimension attribute table


select DisplayValue from dimAttrView
where dimAttrView.ValueCombinationRecId == _ledgerDimension //generalJournalAccountEntry.LedgerDimension
join BackingEntityType from dimAttr
where dimAttr.RecId == dimAttrView.DimensionAttribute
&& dimAttr.Name == _dimensionName; // Dimension field name

return dimAttrView.DisplayValue;
}

No comments:

Post a Comment

Give me the commetns and solutions

Ledger Voucher creation Framework and x++ code to create ledger voucher

 Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension-...