web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / DynamicsAXWorld / Find dimension values throu...

Find dimension values through X++ code

gangadhar reddy Profile Picture gangadhar reddy 527

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

Dim

 



This was originally posted here.

Comments

*This post is locked for comments