How to: Get a especific financial dimension value
Views (90)
Good day everyone! Today I will leave a quick tip about how to get a specific financial dimension value through DimensionDefault.
If you don’t know what a financial dimension is, here is a quote from “Implementing the Account and Financial Dimensions Framework for Microsoft Dynamics AX 2012 Applications” White paper
A financial data classifier created from the parties, locations, products,
and activities in an organization and used for management reporting.
Follow the code:
private str getCostCenterByDefaultDimension(RecId _dimensionDefault)
{
DimensionAttributeValueSetStorage dimStorage;
Str costCenter;
Counter i;
// DimensionDefault is a RecId that combines all Dimension Values
dimStorage = DimensionAttributeValueSetStorage::find(_dimensionDefault);
for (i= 1 ; i<= dimStorage.elements() ; i++)
{
// Change the string "CostCenter" to whatever financial dimension you want
if(DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name == "CostCenter")
{
costCenter = dimStorage.getDisplayValueByIndex(i);
}
}
return costCenter;
}
This was originally posted here.

Like
Report
*This post is locked for comments