Saturday, 23 January 2010

AX - Loop through dimensions

This is a good article regarding handling dimensions in code.
http://blogs.msdn.com/palle_agermark/archive/2006/03/30/Additioanl-Financial-Dimensions.aspx

General idea to loop through dimensions.
static void PrintDimensions(Args _args)
{
    Dimension   dimension;
    int         numOfDimensions, i;
;
    numOfDimensions = dimOf(dimension);
    
    for (i = 1; i <= numOfDimensions; i++)
    {
        info(myTable::find('1001').dimension[i]); 
    }
}

No comments: