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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Difference between query in AOT and X++

(0) ShareShare
ReportReport
Posted on by 2

I created the AOT query and X++ query with same syntax.  What is the difference between theses and if i uses the AOT query Is it faster then the X++ query(in both syntax is same)

I have the same question (0)
  • Suggested answer
    GirishS Profile Picture
    27,827 Moderator on at
    RE: I created the AOT query and X++ query with same syntax. What is the difference between theses and if i uses the AOT query Is it faster then the X++ query(in both syntax is same)

    Hi Sachin mittal,

    I think there is not much difference in performance. But it will improve the code readability if you use the AOT query in code.

    Since you added all the tables as a DataSource to the AOT query and use it in the code to add the range and further steps.

    But if you build normal X++ dynamic query you will need to mention the tables and the related tables and set the joins.

    Thanks,

    Girish S.

  • GirishS Profile Picture
    27,827 Moderator on at
    RE: I created the AOT query and X++ query with same syntax. What is the difference between theses and if i uses the AOT query Is it faster then the X++ query(in both syntax is same)

    One more advantage of using AOT query is using Dynamic field property on the each DataSource.  You can set the required field to be added to each tables instead of all the table fields to the query. This can also be set on X++ query using selection field property.

    Thanks,

    Girish S.

  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at
    RE: I created the AOT query and X++ query with same syntax. What is the difference between theses and if i uses the AOT query Is it faster then the X++ query(in both syntax is same)

    Hey Sachin, Please check ChatGpt response on this. Now I can't verify all points but its good to know and explore these criteria's.

    Performance can be tested by creating AOT and x++ query with same data structure and check time to fetch data.

    Criteria AOT Queries X++ Queries
    Definition AOT queries are pre-defined queries that are created and managed in the Application Object Tree (AOT). They are designed for end-users to easily access data without needing to write any code. X++ queries are custom queries that are created using X++ code. They are more flexible and can be tailored to specific business requirements.
    Ease of Use AOT queries are easier to use since they don't require any coding knowledge. End-users can easily access and run them from the user interface. X++ queries require coding knowledge and can be more difficult for end-users to use. They need to be executed from a developer environment.
    Performance AOT queries are faster since they are pre-compiled and optimized by the system. They are designed for read-only scenarios and are best suited for simple queries. X++ queries are slower since they need to be compiled and executed each time they are run. They are designed for more complex scenarios and can support read-write operations.
    Flexibility AOT queries are less flexible since they are pre-defined and cannot be modified by end-users. Developers can modify them by changing the query properties in the AOT. X++ queries are highly flexible and can be customized to meet specific business requirements. Developers can modify them at runtime by changing the query properties in code.
    Debugging AOT queries are easier to debug since they are pre-compiled and optimized by the system. Developers can easily see the query results and modify the query properties in the AOT. X++ queries are more difficult to debug since they need to be compiled and executed each time they are run. Developers need to use the developer environment to debug them.

    In summary, AOT queries are easier to use and faster, but less flexible and more limited in their capabilities. X++ queries are more difficult to use and slower, but highly flexible and customizable to meet specific business requirements.

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 683 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 398 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans