New version AX 2012 (6.0) :
In earlier version, accessing dimension values was very simple like
CustTable.Dimension[0] == Department value
CustTable.Dimension[1] == CostCenter value
CustTable.Dimension[2] == Purpose value
In AX 60, since they have replaced Dimension EDT with RecId DimensionDefault we have to make use of Dimension helper classes to access values.So in CustTable you will find defaultDimension field which stores reference recId for DimensionAttributeSet.
I am referringCustomer 1101 in CEU Company, Contoso Demo Data for illustration purpose. Note the dimension values for this customer as shown in below snap.
Refer the code to access the values.
static void DEV_Dimension(Args _args)
{
CustTable custTable = CustTable::find("1101");
DimensionAttributeValueSetStorage dimStorage;
Counter i;
dimStorage = DimensionAttributeValueSetStorage::find(custTable.DefaultDimension);
for (i=1 ; i<= dimStorage.elements() ; i++)
{
info(strFmt("%1 = %2", DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name,
dimStorage.getDisplayValueByIndex(i)));
}
}
When yourun the job, will see as below
- In AX 60, their is no limit to dimension creations. One can create n number of dimensions as per organization requirements.
- Technically their is huge
change in framework, the way these dimensions used to be created and stored. - Firstly EDT Dimension (array) is deprecated and replaced with DimensionDefault (Int64 RecId).
- Financial Dimensions master table Dimension is replaced with DimensionAttribute and DimensionValueDetails.
- Now if one wish to store these dimension on your customized table then instead of EDT Dimension one should add DimensionDefault EDT.
- At Form level make use of DimensionDefaultingController class to show the available dimensions.
In earlier version, accessing dimension values was very simple like
CustTable.Dimension[0] == Department value
CustTable.Dimension[1] == CostCenter value
CustTable.Dimension[2] == Purpose value
In AX 60, since they have replaced Dimension EDT with RecId DimensionDefault we have to make use of Dimension helper classes to access values.So in CustTable you will find defaultDimension field which stores reference recId for DimensionAttributeSet.
I am referring
static void DEV_Dimension(Args _args)
{
CustTable custTable = CustTable::find("1101");
DimensionAttributeValueSetStorage dimStorage;
Counter i;
dimStorage = DimensionAttributeValueSetStorage::find(custTable.DefaultDimension);
for (i=1 ; i<= dimStorage.elements() ; i++)
{
info(strFmt("%1 = %2", DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name,
dimStorage.getDisplayValueByIndex(i)));
}
}
When you
No comments:
Post a Comment