QueryRun Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The QueryRun class traverses tables in the database, fetches records that satisfy constraints that are given by the user, and helps to gather such constraints from user input.
public ref class QueryRun : Dynamics::AX::Application::ObjectRun
[Microsoft.Dynamics.Ax.Xpp.KernelClass]
public class QueryRun : Dynamics.AX.Application.ObjectRun
[<Microsoft.Dynamics.Ax.Xpp.KernelClass>]
type QueryRun = class
inherit ObjectRun
Public Class QueryRun
Inherits ObjectRun
- Inheritance
- Attributes
Remarks
QueryRun objects are used to traverse tables in the database and fetch records that satisfy the constraints that are given by the user. A QueryRun object may interact with the user to let the user enter such constraints. Queries are used internally by reports to delineate and fetch the data to be presented in the report. A QueryRun object relies on a Query object to define the structure of the query (for example, which tables are searched and how the records are sorted). A QueryRun object defines the dynamic behavior of the query, whereas a Query object defines the static characteristics of the query.
In the following example, it is assumed that there is a query named Customer in the Finance and Operations Application Object Tree (AOT), and that it has one data source, the CustTable table.
static void example()
{
// Create a QueryRun object from a query stored in the AOT.
QueryRun qr = new QueryRun ("Customer");
CustTable customerRecord;
// Display a window enabling the user to choose which records to print.
if (qr.prompt())
{
// The user clicked OK.
while (qr.next())
{
// Get the fetched record.
CustomerRecord = qr.GetNo(1);
// Do something with it
print CustomerRecord.AccountNum;
}
}
else
{
// The user pressed Cancel, so do nothing.
}
}
Constructors
QueryRun() | |
QueryRun(IntPtr) | |
QueryRun(Object) |
Fields
kernelClass | (Inherited from XppObjectBase) |