How to get dimension value from default dimension in Dynamics AX 2012 Through X++
How to get dimension value from default dimension in Dynamics AX 2012 Through X++
static void getDimensionValueFromDefaultDimension(Args _args)
{
DimensionAttributeValueSetStorage dimStorage;
DimensionValue dimAttributeValue;
Counter i;
CustTable custTable = CustTable::find('1002');
dimStorage = DimensionAttributeValueSetStorage::find(custTable.DefaultDimension);
for (i= 1 ; i<= dimStorage.elements() ; i++)
{
if(DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name == 'Dimension name')
{
dimAttributeValue = dimStorage.getDisplayValueByIndex(i);
}
}
info(strFmt(dimAttributeValue));
}
static void getDimensionValueFromDefaultDimension(Args _args)
{
DimensionAttributeValueSetStorage dimStorage;
DimensionValue dimAttributeValue;
Counter i;
CustTable custTable = CustTable::find('1002');
dimStorage = DimensionAttributeValueSetStorage::find(custTable.DefaultDimension);
for (i= 1 ; i<= dimStorage.elements() ; i++)
{
if(DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name == 'Dimension name')
{
dimAttributeValue = dimStorage.getDisplayValueByIndex(i);
}
}
info(strFmt(dimAttributeValue));
}
Comments
Post a Comment