220 likes | 453 Views
Dimension Framework in AX 6 By, Nasheet Ahmed Siddiqui. Agenda. What are dimensions? Dimension Terms Configure Account Structure and Advanced rule. Dimension Data Model How an offset account (10110-D10-CC2) in the Lines Journal saved in the dimension.
E N D
Agenda • What are dimensions? • Dimension Terms • Configure Account Structure and Advanced rule. • Dimension Data Model • How an offset account (10110-D10-CC2) in the Lines Journal saved in the dimension. • Patterns Details and Implementation. • Dimension APIs
What are dimensions? • Dimension are sub account to the general ledger chart of accounts. • They allow an account to be broken-down into additional detail for reporting and analysis.
Dimension Example • Account 3000 has a balance of 100$. This balance can be analyzed by dimension.
How an offset account (10110-D10-CC2) in the Lines Journal saved in the dimension. • Segmented control works with the DimensionStorage class to create the combination • So; we break apart the combination into each structure [10110 - D1] [CC2}. We first save the Account Structure portion of the combination. Then we save the Account/Advanced Rule structure portion (as there could be multiples added thru multiple rules). In the end, this is what that combination will look like across all 4 tables shown in the combination storage block in the Data model bound to the LedgerDimension.
How an offset account (10110-D10-CC2) in the Lines Journal saved in the dimension. • Configure an account structure that looks like this: Main Account + Department • (See the attached document for how to configure account structure) • Create an advanced rule attached to account structure to say that when you enter 10110 - D1 you also need to specify a Cost Center. • (See the attached document for how to create advanced rule)
How an offset account (10110-D10-CC2) in the Lines Journal saved in the dimension. • An Segmented entry control will look like this • As account structure configure there are 2 segments that must be filled. • Type 10110 and tab it looks like this: 10110 - • Type D1 in the second segment and tab • As tab press we pick up the fact that a rule is attached and a 3rd dimension must be added to the combination so it looks like this: 10110 - D1 - • Now the user enters CC2 and tabs from the control 10110 - D1 - CC2
How an offset account (10110-D10-CC2) in the Lines Journal saved in the dimension. • DimensionAttributeValueCombination: • DisplayValue: "10110 - D1 – CC2"RecId: 400 • DimensionAttributeValueGroupCombination: • DimensionAttributeValueCombination: 400DimensionAttributeValueGroup: 500RecID: 201 • DimensionAttributeValueGroupCombination: • DimensionAttributeValueCombination: 400DimensionAttributeValueGroup: 501RecID: 202 • DimensionAttributeValueGroup: • DimensionHierarchy: AccountStructure(MA+DEPT)RecID: 500 • DimensionAttributeValueGroup: • DimensionHierarchy: AdavancedRule (CC)RecID: 501
How an offset account (10110-D10-CC2) in the Lines Journal saved in the dimension. • DimensionAttributeLevelValue:DimensionAttributeValueGroup: 500 Ordinal: 1DimensionAttributeValue->10110RecId: 601DimensionAttributeLevelValue:DimensionAttributeValueGroup: 500 Ordinal: 2DimensionAttributeValue->D1RecId: 602DimensionAttributeLevelValue:DimensionAttributeValueGroup: 501 Ordinal: 1DimensionAttributeValue->CC2RecId: 602 • To insert: [10110 - D1] [CC2] we need to insert above all records as summarized below. • 1 record in DAVC2 Records in DAVGC (to link the full combination to each sub-group) • 2 records in DAVG (one for each grouping) • 3 records in DALV (one for each segment)
Default Account • Default main account + structure • This pattern is referred to as the “LA.A” (Ledger Account.A) pattern. There are various forms in the system that only needs to specify the main account plus the account structure to be used for defaulting purposes. A foreign key representing a default account is a 64 bit integer field that contains the data from the corresponding RecId field the DimensionAttributeValueCombination (LedgerDimension) table as shown here: • The Default Account Control is the combination of the Segmented Entry Control and the LedgerDimensionDefaultAccountController class. The Segmented Entry Control is a general purpose control that was introduced to AX 6 and the LedgerDimensionDefaultAccountController class is a class that handles the events raised by the Segmented Entry Control.
Main Account • The Main Account pattern represents just one of the potential segments in a ledger account. When referencing a Main Account as a foreign key a developer should setup a reference to the RecId field in the MainAccount table. There is no special control for this pattern. • The most interesting issue when doing reporting or general querying of MainAccount data is that most of the fields are shared through the chart of accounts that is specified in the MainAccount table. Each MainAccount record must have a valid chart of accounts foreign key. Only 1 chart of accounts can be specified for a given ledger.
Ledger Account • A ledger account contains the main account, account structure, and each financial dimension value needed to fulfill the related account structure and account rule structures. A foreign key representing a ledger account is a 64 bit integer field that contains the data from the corresponding RecId field the DimensionAttributeValueCombination (LedgerDimension) table. • The ledger account control uses the LedgerDimensionAccountController class as its controller class. This control handles the entry and display of ledger accounts in AX forms.
Default Dimension • This pattern represents a set of financial dimensions and their related values. All default dimensions are tracked without any respect to structure or active dates or closed states. Since they are used as defaults, they get validated by the account number control or defaulting engine when used on a transaction. At that time validation is performed to determine if the default can be used or not. • A dimension set is a list of 1 or more dimension attributes that are being tracked for a particular purpose. Each element has an enumeration value. • In simple scenarios the changes needed on an AX form are as follows:
Dimension APIs • DimensionStorage • DimensionStorage::getMainAccountFromLedgerDimension • DimensionStorage::getMainAccountNameFromLedgerDimension • DimensionConversionHelper • DimensionConversionHelper::getNativeDefaultAccount() • DimensionConversionHelper::getNativeDefaultDimension() • DimensionConversionHelper::getNativeLedgerDimension () • DimensionDefaultingService • DimensionDefaultingService::serviceCreateLedgerDimension() • DimensionDefaultingService::serviceMergeLedgerDimensions() • DimensionAttributeValueCombination • DimensionAttributeValueCombination::getDisplayValue()
Demo - Ledger Account How to implement Ledger account on the existing form. • Verify that the table that holds the Foreign Key to the DimensionAttributeValueCombination table is a data source on the form. • Drag the LedgerDimension field from the data source to the desired location on form design. • Add code for controller initialization in the init method of the form. • Override methods on the SegmentedEntrycontrols