Sunday, December 22, 2013

Dimensions framework in AX 2012

In Microsoft Dynamics AX 2012, the account and financial dimensions framework has been enhanced to provide
more functionality.
To support this new functionality, the data model has also been completely redesigned.
Therefore, developers will need to update every reference to ledger accounts and financial dimensions
in existing applications to reference the new data model.

Segmented Entry control:
Account form controls combine the Segmented Entry control and a controller class. 
The Segmented Entry control is a general-purpose Microsoft Dynamics AX client control that is being introduced in AX 2012. 
The controller class is an X++ class that handles the events raised by the Segmented Entry control. 
The combination of a control and an underlying class allows the user to see a dynamic number of segments, based on the values the user provides

Main account and ledger account :
In previous versions of Microsoft Dynamics AX, the term ledger account was used to specify what is now referred to as the main account
In AX 2012, the main account is merged with financial dimensions to create a more integrated view of the chart of accounts
In AX 2012 a ledger account contains the main account, account structure, and the financial dimension values that are needed to populate the related account structure ledger account is a 64-bit integer field that contains the data from the corresponding RecId field in the DimensionAttributeValueCombination table

In previous versions of Microsoft Dynamics AX, the term ledger account was used to specify what is now referred to as the main account
In AX 2012, the main account is merged with financial dimensions to create a more integrated view of the chart of accounts
In AX 2012 a ledger account contains the main account, account structure, and the financial dimension values that are needed to 
populate the related account structure ledger account is a 64-bit integer field that 
contains the data from the corresponding RecId field in the DimensionAttributeValueCombination table

Changes needed on the form to add segmented entry control:

Add the LedgerDimension field from the data source to the desired location on the form design. 
This should add a Segmented Entry control at this location on the form with appropriate DataSource and ReferenceField property values.
Or add a Segmented Entry control to the design and manually setting the DataSource and ReferenceField properties

Add the following code in the init method

ledgerDimensionDefaultAccountController =
LedgerDimensionDefaultAccountController::construct(myTable_ds, fieldstr(MyTable, LedgerDimension));

Following methods on the form needs to be overriden for the segemnted control

jumpRef, validate,loadSegment, segmentValueChanged, loadAutoCompleteData, resolveReference(dataSource)

Classes related to dimensions:
Some of the classes can  be used to implement/ make use of dimension framework
DimensionDefaultingController class handles drawing of individual field controls for each financial dimension for the 
current ledger’s account structures, and field entry/validation, lookup, and “view details” functionality
Classes like DimensionDefaultingEngine, DimensionDefaultingService, DimensionStorage etc can be used to perform various operations on dimesnions like get dimension data, build dimesnions etc..

e.g: DimensionStorage::getDefaultDimensionFromLedgerDimension: Gets the default dimension that represents all dimension values from the specified ledger account other than the main account.
DimensionDefaultingEngine::overrideDefaultDimension: Updates a default dimension with the specified dimension values.


No comments: