Consuming the system query service
The query service is one of the built-in system services in Dynamics AX. The service provides a set of operations allowing any AOT or dynamic query to be executed. The results are returned as an ADO.NET DataSet
object. The query service cannot be customized and is hosted on the Application Object Server at a fixed address.
In this recipe, we will create a .NET console application that will connect to the query service. The application will retrieve a list of currencies in the system, with the help of a dynamically created query.
How to do it...
Carry out the following steps in order to complete this recipe:
1. In Visual Studio, create a new Visual C# Console Application project named
ConsumeSystemQueryService
.2. Add a new service reference named
QueryService
, to the project (replaceSEA-DEV:8101
with your address):3. Add the following code to the top section of the
Program.cs
file:using ConsumeSystemQueryService.QueryService; using System.Data;
4. Add the...