Financial Dimesnisons in ax 2012

x++ code to get financial dimensions of customer in ax 2012.

    DimensionAttribute                              dimAttr;
    DimensionAttributeValue                    dimAttrValue;
    DimensionAttributeValueSetItem       dimAttrValueSet;
 
void customerFinacialDimensions(DimensionDefault  _defaultDimension)
{
      while  select DimensionAttributeValueSet,DimensionAttributeValue,DisplayValue from             dimAttrValueSet
                where dimAttrValueSet.DimensionAttributeValueSet    == _defaultDimension
            join RecId,DimensionAttribute from dimAttrValue
                where dimAttrValue.RecId  == dimAttrValueSet.DimensionAttributeValue
            join RecId,Name from dimAttr
                where dimAttr.RecId       == dimAttrValue.DimensionAttribute
        {
                info(strfmt("%1 %2",dimAttr.Name,dimAttrValueSet.DisplayValue);
                     
        }
     
}
 customerFinacialDimensions(CustTable::find('12343').defaultDimension);

Thanks.





       

Comments

Popular posts from this blog

x++ code to add hyperlink to a field in D365FO

x++ code to get Vendor Email Address based on Purpose in Dynamics 365 for Operations

x++ code to get Customer Address based on purpose in ax 2012