Find dimension values through X++ code
Views (879)
In some cases we may need to find dimension values and its name associated to an entity like customer, purchase order, project etc.. Below is a code sample to find dimension values and its name.
DimensionAttributeValueSetStorage dimStorage;
CustTable custTable;
Counter i;
custTable = CustTable::find(‘TestCustomer’);
dimStorage = DimensionAttributeValueSetStorage ::find(custTable .DefaultDimension);
for (i=1 ; i<= dimStorage.elements() ; i++)
{
info(DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name +”–>” + dimStorage.getDisplayValueByIndex(i));
}
Below is the sample output of above code

This was originally posted here.
*This post is locked for comments