Reputation: 51
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))
Upvotes: 1
Views: 7398
Reputation: 3469
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
Upvotes: 2
Reputation: 2354
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)));
}
}
Upvotes: 4