简体   繁体   中英

Dynamics AX 2012 Financial Dimensions

How can I get similar results to my ax09 query,

SELECT DIMENSION, DIMENSION2_ FROM CUSTTABLE

in Dynamics AX 2012?

I understand the tremendous complexity of the new dynamic dimension structure. With this new structure is there even a way to reproduce a select statement like the one above?

Here are the tools I have to work with:

1. SQL Server Management Studio 2008
2. DAX AOT
3. BIDS (MS SQL Server 2008 R2 (SSRS))

There is a great article here about creating a helper class to solve this exact problem;

http://learnax.blogspot.co.uk/2011/08/dynamics-ax-2012-financial-dimensions.html

This is the new code Nagaraj Jadhav has posted on his blog to achieve this;

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))); 
    }
}    

Look in the white paper Implementing the Account and Financial Dimensions Framework for a description of how Default dimensions are implemented. There is a view DefaultDimensionView that you can use to retrieve dimension information:

SELECT DEFAULTDIMENSIONVIEW.NAME, DEFAULTDIMENSIONVIEW.DISPLAYVALUE, CUSTTABLE.ACCOUNTNUM
FROM DEFAULTDIMENSIONVIEW 
INNER JOIN CUSTTABLE 
ON DEFAULTDIMENSIONVIEW.DEFAULTDIMENSION = CUSTTABLE.DEFAULTDIMENSION

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM