Ledger account combinations - Part 2 (Dimension enumerations, default dimensions)
Introduction
Continuing this series of blog posts, we will cover the Dimension Enumerations and Default Dimensions sections highlighted in pale yellow in the model in figure 1 below.
Dimension enumerations and default dimensions are two storage mechanisms to store a set of references to either dimensions or dimension values. These commonly are exposed on a Financial dimensions tab on master data forms such as Customers (CustTable) or Vendors (VendTable).
Figure 1: Sets in framework
Dimension Enumerations
A dimension enumeration is a set of references to existing dimensions that are persisted for later use. These dimensions have no particular ordering and no constraints on which dimensions appear within the set by the dimension framework. However, in most instances, the set is constrained by the consuming code to the set of dimensions available in the current ledger. A dimension enumeration is stored in the DimensionAttributeSet and DimensionAttributeSetItem tables.
The set specifies an enumeration type which is the enumNum() of the BaseEnum that represents the source of enumeration values to associate with each dimension. Therefore, this is a list of enumeration values as defined by the developer; not a list of user-entered values from backing entities. In Dynamics AX 2012 R2, an example of this is storage of a list of dimensions that are to be Fixed, labeled as Fixed value, or NotFixed, labeled as Not fixed, which are associated with each main account.
Figure 2: Dimension enumerations on a form
In the above example in figure 2, the enumeration DimensionFixed is used to constrain the list of values in the drop down list.
Figure 3: A dimension enumeration BaseEnum
The value entered represents one item with a "1" EnumValue (DimensionFixed::Fixed) and the other one with the default "0" EnumValue (DimensionFixed::NotFixed). The DimensionAttributeSet is stored as follows:
Figure 4: Dimension enumeration storage query results
The MainAccountLegalEntity record references the DimensionAttributeSet record by its FixedDimensions field. The DimensionAttributeSet represents the combination of dimensions for the enumeration type. The DimensionAttributeSetItem records represent each dimension and enumeration value pair in the set, where the enumeration value is represented by its integer value.
The same pattern extends to the use of the NoYes BaseEnum which can be rendered in the UI as either combo boxes similar to the example above in figure 2, or as checkboxes as shown below in figure 5.
Figure 5: Alternate rendering of dimension enumerations on a form
Default dimensions
Similar to how dimension enumerations hold a set of dimensions with an associated enumeration value; a default dimension holds a set of dimensions with specific dimension values. The name default dimensions comes from the fact that these are typically entered on master data records and not directly on transactions and are used in the defaulting of values into a ledger account combination. Similar to dimension enumerations, there is no specific structure associated with these and in most instances the set is constrained by the consuming code to the dimensions available for the current ledger. A default dimension is stored in the DimensionAttributeValueSet and DimensionAttributeValueSetItem tables.
Figure 6: Default dimensions on a form
In the above example in figure 6, the user has selected a dimension value to associate with each dimension. These values are stored in the DimensionAttributeValueSet and DimensionAttributeValueSetItem tables as follows:
Figure 7: Dimension value tables query results
The MainAccountLegalEntity record holds a foreign key (FK) reference to the DimensionAttributeValueSet table which represents the combination of entered values. This table represents the set of dimensions value pairs held in the DimensionAttributeValueSetItem table.
The DimensionAttributeValueSetItem table holds one record for each entered dimension value, which references a DimensionAttributeValue. No records are stored for a dimension that has not been entered (left blank). In the DimensionAttributeValue table, there are now two records that were created when the default dimension was entered because the dimension value has now been used within the dimension framework. This links the dimension framework values with the backing entities. For performance reasons, the natural key (display value) of the dimension value is stored on the DimensionAttributeValueSetItem table.
By following the link stored in the EntityInstance field on the DimensionAttributeValue table, along with the associated ViewName on the DimensionAttribute table, we can find the record in the originating tables of CustTable (via the DimAttributeCustTable view) and DimensionFinancialTag to get to the source of the values.
In the next blog post, the storage of account structures and constraints will be explained.