Microsoft Dynamics AX Support

This blog contains posts by the Microsoft Dynamics AX Support teams Worldwide

Creating Financial Dimension Combinations in AX 2012

Creating Financial Dimension Combinations in AX 2012

Rate This
  • Comments 2

In AX 2012 there are a couple of different ways you can programmatically create combinations of dimensions.  These combinations are saved as records in the DimensionAttributeValueCombination table.  The RecId from the DimensionAttributeValueCombination table is what is saved in the LedgerDimension field on the LedgerJournalTrans table.


The first and best way to create dimension combinations is to use the class and method DimensionServiceProvider\buildDimensionStorageForLedgerAccount.  The buildDimensionStorageForLedgerAccount method takes a
LedgerAccountContract class.  In the LedgerAccountContract class there are two parm methods, parmMainAccount and parmValues.  The parmMainAccount method takes the MainAccount like ‘10060’ and the parmValues method takes a list of the other dimension values you want to set.  More specifically the parmValues method takes a list of classes.  The classes are of type DimensionAttributeValueContract.  On the DimensionAttributeValueContract class you set two
methods, parmName and parmValue.  For example, ‘Department’ for the name and ‘10’ for the value. Build up a list of DimensionAttributeValueContract classes for each dimension you want to specify and then pass the list to the parmValues method on the LedgerAccountContract class.  Once you have the LedgerAccountContract built up send it to the DimensionServiceProvider\buildDimensionStorageForLedgerAccount.

 

Optionally you can use a utility method in AX in AxdDimensionUtil\getLedgerAccountId.  This one is not as nice as buildDimensionStorageForLedgerAccount because it takes a container instead of a class (with known types).  Here’s an example of the method in AX:

container myContainer = ["110180-USAA", “110180”, 1, "Country", "USAA"];  //The third argument, 1, indicates the number of dimensions you are going to include, this does not include the main account.

AxdDimensionUtil::getLedgerAccountId(myContainer);

 

Here is another example constructing the contents of the
container with the dimensions included in the demo data

    // Construct input

    dimensionValueIn =

    [

        // Display value      
        strFmt('%1-%2-%3-%4', ‘10060’, '10’, ‘2020’, ‘M010’),

         // Main account

        ‘10060’,

         // Segment count

        3,

         // 2nd segment of 1st hierarchy

        ‘Department’, ‘10’,

 

        // 3rd segment of 1st hierarchy

        ‘Center’, ‘2020’,

         // 4th segment of 1st hierarchy

        ‘Purpose’, ‘M010’

    ];

Leave a Comment
  • Please add 6 and 7 and type the answer here:
  • Post
  • Hi Becky,

    Hi.Hope ur doing good.Am Chamantha.

    I have a requirement.

    In AX 2012, I am asked to add a financial Dimension Value...For Example to add a Business Unit in a ProjectsListPage.

    Please help in adding a financial Dimension field value to a listpage.

    Thanks,

    Chamantha.K

    mail me @ chamantha.K@servion.com

    call me @ +91-9894885682

  • Chamanta - you should be able to find the information you need in the whitepaper we have published around implementing the new financial dimension framework, which can be found here: download.microsoft.com/.../Implementing_the_Account_and_Financial_Dimensions_Framework_AX2012.pdf

    You will want to look at the section around adding a default dimension field to a form.

    Kevin

Page 1 of 1 (2 items)