static void getDimensionValueFromDefaultDimension(Args _args)
{
    #define.DimensionName('MyCustomDim')
    DimensionAttributeValueSetItem dimAttrValueSetItem;
    DimensionAttributeValue dimAttrValue;
    DimensionAttribute dimAttr = DimensionAttribute::findByName(#DimensionName);

    str dimensionValue;
    ProjTable projTable;

    projTable = ProjTable::find('DummyProjId');

    select firstOnly DisplayValue from dimAttrValueSetItem
        where dimAttrValueSetItem.DimensionAttributeValueSet == projTable.DefaultDimension
        exists join dimAttrValue
            where dimAttrValue.RecId == dimAttrValueSetItem.DimensionAttributeValue
            && dimAttrValue.DimensionAttribute == dimAttr.RecId;

    dimensionValue = dimAttrValueSetItem.DisplayValue;

    info(dimensionValue);
}
Categories: AX2012

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

eighteen − 17 =