Menu Close

AX 2012 Split Default Dimension to get Department

Public display Description Department()
{


Name dimensionAttributeName;
RecId DepartmentAttribute;
DefaultDimensionView dimensionView;
DimensionAttribute dimensionAttribute;
DimensionAttribute dimAttribute;

dimensionAttributeName = "Department";
DepartmentAttribute = DimensionAttribute::findByName('Department').RecId;


select firstOnly dimensionView
where dimensionView.DefaultDimension == this.DefaultDimension

join dimensionAttribute
where dimensionView.Name == dimensionAttribute.Name &&
dimensionView.Name == dimensionAttributeName;
dimAttribute = DimensionAttribute::find(dimensionView.DimensionAttributeId);
return DimensionFinancialTag::findByFinancialTagCategoryAndValue(dimAttribute.financialTagCategory(), dimensionView.DisplayValue).Description;
}

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.