Tuesday, June 28, 2011

Cycle through datasources and ranges to find values

Here is some basic code to cycle through a datasource in AX 2009 X++ and then loop through all of the data sources and their ranges and present some info to the users. Its nice for analyzing queries if something is not acting right. 

If you use this code, please leave me a comment and say thank you.  Its nice just to have someone say hi or thanks for using code like this.  If you don't use it and it helps you out, feel free to say so to.  We're all friends here :-)

// START CODE
// 2009 DAX DUDE

    int test1;
    int test2;
    int dsCount;
    int dsPlace;
    QueryBuildRange qbrTEST;
    QueryBuildDatasource qbdsTest;

    dsCount= queryRun.query().dataSourceCount();
    for (dsPlace= 1; dsPlace<= dsCount; dsPlace++)
    {
        qbdsTest = queryRun.query().dataSourceNo(dsPlace);

        test1 = qbdsTest.rangeCount();

        for (test2 = 1; test2 <= test1; test2++)
        {
            qbrTEST = qbdsTest.range(test2);

            info (strFmt("Range Field %1, Value %2", qbrTEST.AOTName(), qbrTEST.value()));
        }
    }
// END CODE

GUEST POST: Setup email alerts in DAX 2009

I have to include a reference to Nagaraj Jadhav's blog as he does a great job with all his posts.

This is a great blog around setting up email alerts in AX 2009.  I would normally try to improve upon things but I don't think I can on this one. Enjoy!

Below
http://learnax.blogspot.com/2010/12/setup-email-alerts-in-dax-2009.html