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 :
Finance | Project Operations, Human Resources, ...
Answered

AOT query - what to use to loop over many records(While function)?

(0) ShareShare
ReportReport
Posted on by 678

Hi,

We do have two ways of creating a query:

1) Query by using AOT (visualization)

2) Query by using X++

I know that we can use 'while' select statement to loop over many records in query using X++

But then is there a way that we can achieve the effect of 'while' function if we have to create a query using AOT..? Or do we ALWAYS have to create query in x++ if we have to loop over many records ?

Thank you. 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Sergei Minozhenko Profile Picture
    23,093 on at

    Hi ShawnDEV,

    Do you want to use the query created in AOT in x ?

    If yes, you can do it with QueryRun object

    Query query = new query(queryStr(MyQuery));
    QueryRun = queryRun = new QueryRun(query);
    
    while (queryRun.next())
    {
        MyTable myTable = queryRun.get(tableNum(MyTable));
    }

  • Verified answer
    Martin Dráb Profile Picture
    237,805 Most Valuable Professional on at

    I'm lockling this thread, because it duplicates what's already discussed in ShawnDEV's other thread.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans