web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Is it possible to view all select query result in AX debugger?

(0) ShareShare
ReportReport
Posted on by

Hi All,

I'm new to AX world. I wanna to know is it possible to view all select query result in AX debugger without print it to InfoLog? It is something similar function provided in Visual Studio, we able to view all DataTable result while debugging.


Thank you.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    No there is no such feature available in Dynamics AX debugger similar to Visual Studio.

  • Suggested answer
    Community Member Profile Picture
    on at

    Moreover if you see Dynamics AX Table instance variable if keeps one record at time and to view all the records we need to utilize While Select

    where as DataTable in Visual studio keeps array of records

    Please verify and update us if you need more details

  • Bashir Ahmad Profile Picture
    5,248 on at

    no, we cannot view data directly like in VS, there is some workaround required to test is query returning results or not. for example:

    The idea is that you have a query you have created, and now your not getting the data you think you should. The best way I have found, for debugging such a report data source, is via an X++ job.

    The following is an example job that can be used, for doing just that.:

    static void TestQuery(Args _args)
    {
    
    /*
    Example job used to test query results with.:
    */
    
    QueryRun queryRun;
    Counter totalRecords;
    
    // Table Variables:
    
    VendTable vend;
    VendCertification VendCert;
    
    queryRun = new QueryRun(queryStr(queryVendCertInfo));
    
    if (queryRun.prompt())
    {
    while (queryRun.next())
    {
    vend = queryRun.get(tableNum(VendTable));
    info(Vend.AccountNum);
    
    VendCert = queryRun.get(tableNum(VendCertification));
    info(VendCert.CertificationNumber);
    
    totalRecords++;
    }
    }
    
    info(strFmt("Total Records : %1", totalRecords));
    
    } 


  • Community Member Profile Picture
    on at

    If your code is complex, Try to use SQL Profiler and see what query it shows in trace and pick up that query and run in SQL Query analyzer.

  • Suggested answer
    Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    You can't just look at the buffer used in your select statement. Unlike DataTable, it's not a collection - it's a single record with a pointer to the next record.

    One solution is iterating the recordset and checking the actual record in debugger. If you want to see all records at once, the best way probably is putting them into a collection, running your code in CIL and looking at them in Visual Studio as usual (see Tips for CIL debugging: Collection classes).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans