Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Microsoft Dynamics AX 2012 Services

You're reading from   Microsoft Dynamics AX 2012 Services Everything you need to know about implementing services with Microsoft Dynamics AX 2012 is contained in this hands-on guide. Easy to follow and totally practical, it's a must for both new and experienced AX Dynamics developers.

Arrow left icon
Product type Paperback
Published in Dec 2012
Publisher Packt
ISBN-13 9781849687546
Length 196 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Query service


The query service enables us to retrieve data from Microsoft Dynamics AX without having to use the .NET Business Connector or, even worse, access the SQL database directly.

By using the query service, you can fetch data using any of the following query types:

  • Static query: This is used to retrieve data by using queries that are present in the AOT. We will use this type in the demonstration.

  • User-defined query: A query can also be created by using the QueryMetadata class. By doing this, you can create a query in the same way as you create queries in X++ code.

  • Dynamic query: Another way of running a query is by creating an X++ class that extends the AifQueryBuilder class. You can invoke the ExecuteQuery operation by passing in the name of the query builder class. It is also possible to pass arguments by using a class that extends from the AifQueryBuilderArgs class.

Fetching data for the grid

Now let's put some code behind the clicked event handler of the Refresh button. The idea is...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image