Financial Dimensions in AX 2012
Today we will be exploring the new changes related to
Financial dimensions in AX 2012.
Earlier versions AX 2009, 4.0 :
Ø
In older version System
use to limit the creation of dimensions up to 10.
Ø By default 3 dimensions were available in the system namely
Department, CostCenter and Purpose.
Ø
Technically these
dimensions were controlled by Enum SysDimension and an array EDT Dimension.
Ø
So If we have 3 enum
elements in SysDimension, then its corresponding array elements are stored
in dimension EDT and can be referred as Dimension[0],
Dimension[1].....
Ø
If you would like to
store these dimension values against customized table, then simply we were
adding the EDT Dimension to that Table. At Form level
simply drag and drop field on Group then system use to show all the array
elements as string control.
New
version AX 2012 (6.0) :
Ø
In AX 2012(6.0), there
is no limit to dimension creations. One can create n number of dimensions as
per organization requirements.
Ø
Technically there 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.
How to access
Financial Dimensions values in AX 2012:
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 6.0, 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.
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 6.0, 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
![https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5nG5yMvziQjNXpDqVkiB0d2dWaB2Rz_FVwEZPipHbln9ky4Ml-IU2NpNM-4ukCFWHUW-aiLbhllIB0ZVtjlzJOzZpkRets1vj6ZZPv84g3q9l3drapNlJeDukOh0XkIU_ugt3LOL3jWLm/s320/FinancialDimensions.jpg](file:///C:/Users/hp/AppData/Local/Temp/msohtmlclip1/01/clip_image002.jpg)
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
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
![https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbqNnH6Z997UhyLUgpsCQZxfOAGrUbzd9O80dN0gfmdv-WL39IxhSZZuCVMlIZvE4eXZVs0B-ZQYWAdAdg7oeM-7_lknL9tCnVeEbHFlygH5rnp7OkhLNSa3oBYJ0XCQdr5x1HSXJPKV0K/s320/DimensionOutput.jpg](file:///C:/Users/hp/AppData/Local/Temp/msohtmlclip1/01/clip_image004.jpg)
Comments
Post a Comment