Friday, June 30, 2017

x++ code to find Financial dimension Display value for based on default dimension with respective Dimension attribute in ax 2012


Hi Reader's,

lets learn small tip to show up display value based on default dimension with respective Dimension attribute in ax 2012

Note:

1)Here DimensionDefault is financial dimension combination( i.e recid),
2)Name is Like Dimension attribute name(ex Department).


public static DimensionValue getDimensionValue(DimensionDefault _dimensionDefault, Name _dimensionAttributeName)
{
    DimensionAttribute                 attribute;
    DimensionAttributeValueSetItemView valueSetItemView;

    attribute   = DimensionAttribute::findByName(_dimensionAttributeName);

    select DisplayValue from valueSetItemView
        where valueSetItemView.DimensionAttributeValueSet == _dimensionDefault
        && valueSetItemView.DimensionAttribute == attribute.RecId;

    return valueSetItemView.DisplayValue;
}

Keep Daxing !!!

No comments:

Post a Comment

Export a copy of the standard user acceptance testing (UAT) database

 Reference link: Export a copy of the standard user acceptance testing (UAT) database - Finance & Operations | Dynamics 365 | Microsoft ...