Share via


QueryRun Class

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.

Syntax

class QueryRun extends ObjectRun

Run On

Called

Methods

  Method Description
Gg923354.pubmethod(en-us,AX.60).gif addPageRange
Gg923354.pubmethod(en-us,AX.60).gif allowCheck
Gg923354.pubmethod(en-us,AX.60).gif allowCrossCompany
Gg923354.pubmethod(en-us,AX.60).gif applyValueBasedPaging
Gg923354.pubmethod(en-us,AX.60).gif args Returns the arguments that the object was constructed with. (Inherited from ObjectRun.)
Gg923354.pubmethod(en-us,AX.60).gif attach Reverses a call to the method. This is the reverse of calling the ObjectRun.detach method. Reversing the call disallows any further switching of focus between windows. (Inherited from ObjectRun.)
Gg923354.pubmethod(en-us,AX.60).gif cancelTimeOut Cancels a previous method call to the setTimeOut method. (Inherited from Object.)
Gg923354.pubmethod(en-us,AX.60).gif canPage
Gg923354.pubmethod(en-us,AX.60).gif changed Determines whether the specified data source has fetched a new value since the last call to the QueryRun.next method.
Gg923354.pubmethod(en-us,AX.60).gif changedBy Gets or sets the name of the user who last changed the application object.
Gg923354.pubmethod(en-us,AX.60).gif changedDate Gets or sets the date an application object was last changed.
Gg923354.pubmethod(en-us,AX.60).gif changedNo
Gg923354.pubmethod(en-us,AX.60).gif changedTime Gets or sets the time an application object was last changed.
Gg923354.pubmethod(en-us,AX.60).gif createdBy Gets or sets the name of the user who created the application object.
Gg923354.pubmethod(en-us,AX.60).gif creationDate Gets or sets the date an application object was created.
Gg923354.pubmethod(en-us,AX.60).gif creationTime
Gg923354.pubmethod(en-us,AX.60).gif description
Gg923354.pubmethod(en-us,AX.60).gif detach Allows focus to be switched between windows. (Inherited from ObjectRun.)
Gg923354.pubmethod(en-us,AX.60).gif enablePositionPaging
Gg923354.pubmethod(en-us,AX.60).gif enableValueBasedPaging
Gg923354.pubmethod(en-us,AX.60).gif equal Determines whether the specified object is equal to the current object. (Overrides the equal Method.)
Gg923354.pubmethod(en-us,AX.60).gif form
Gg923354.pubmethod(en-us,AX.60).gif get Retrieves the record fetched by the previous call to next method.
Gg923354.pubmethod(en-us,AX.60).gif getNo Retrieves the record fetched by the previous call to QueryRun.next Method.
Gg923354.pubmethod(en-us,AX.60).gif getTimeOutTimerHandle Returns the timer handle for the object. (Inherited from Object.)
Gg923354.pubmethod(en-us,AX.60).gif handle Retrieves the handle of the class of the object. (Inherited from Object.)
Gg923354.pubmethod(en-us,AX.60).gif init
Gg923354.pubmethod(en-us,AX.60).gif interactive
Gg923354.pubmethod(en-us,AX.60).gif isDetached Communicates whether an ObjectRun.detach method call has been made on this object. (Inherited from ObjectRun.)
Gg923354.pubmethod(en-us,AX.60).gif isPositionPagingEnabled
Gg923354.pubmethod(en-us,AX.60).gif isQueryTimedout
Gg923354.pubmethod(en-us,AX.60).gif isValueBasedPagingEnabled
Gg923354.pubmethod(en-us,AX.60).gif literals
Gg923354.pubmethod(en-us,AX.60).gif name Gets or sets the name that is used in code to identify a form, report, table, query, or another Microsoft Dynamics AX application object.
Gg923354.pubmethod(en-us,AX.60).gif new Initializes a new instance of the Object class. (Overrides the new Method.)
Gg923354.pubmethod(en-us,AX.60).gif newObject
Gg923354.pubmethod(en-us,AX.60).gif next Retrieves the next record from the query.
Gg923354.pubmethod(en-us,AX.60).gif nextUniqueId
Gg923354.pubmethod(en-us,AX.60).gif notify Releases the hold on an object that has called the wait method on this object. (Inherited from Object.)
Gg923354.pubmethod(en-us,AX.60).gif notifyAll Releases a lock on the object that was issued by the wait method on this object. (Inherited from Object.)
Gg923354.pubmethod(en-us,AX.60).gif objectOnServer Determines whether the object is on a server. (Inherited from Object.)
Gg923354.pubmethod(en-us,AX.60).gif origin
Gg923354.pubmethod(en-us,AX.60).gif owner Returns the instance that owns the object. (Inherited from Object.)
Gg923354.pubmethod(en-us,AX.60).gif pack
Gg923354.pubmethod(en-us,AX.60).gif prompt Presents, to the user, the options for defining the records to be fetched by the query.
Gg923354.pubmethod(en-us,AX.60).gif query
Gg923354.pubmethod(en-us,AX.60).gif queryType
Gg923354.pubmethod(en-us,AX.60).gif recordLevelSecurity
Gg923354.pubmethod(en-us,AX.60).gif report
Gg923354.pubmethod(en-us,AX.60).gif reportRun
Gg923354.pubmethod(en-us,AX.60).gif reset
Gg923354.pubmethod(en-us,AX.60).gif run Opens a form used to obtain information about the query from the user, and fetches the matching records.
Gg923354.pubmethod(en-us,AX.60).gif saved
Gg923354.pubmethod(en-us,AX.60).gif saveUserSetup Saves the user setup.
Gg923354.pubmethod(en-us,AX.60).gif searchable
Gg923354.pubmethod(en-us,AX.60).gif setCursor
Gg923354.pubmethod(en-us,AX.60).gif setQuerytimeout
Gg923354.pubmethod(en-us,AX.60).gif setRecord
Gg923354.pubmethod(en-us,AX.60).gif setTimeOut Sets up the scheduled execution of a specified method. (Inherited from Object.)
Gg923354.pubmethod(en-us,AX.60).gif title
Gg923354.pubmethod(en-us,AX.60).gif toString Returns a string that represents the current object. (Overrides the toString Method.)
Gg923354.pubmethod(en-us,AX.60).gif usageCount Returns the current number of references, that is, the value of the reference counter, that the object has. (Inherited from Object.)
Gg923354.pubmethod(en-us,AX.60).gif userUpdate
Gg923354.pubmethod(en-us,AX.60).gif version
Gg923354.pubmethod(en-us,AX.60).gif wait Pauses a process. (Inherited from Object.)
Gg923354.pubmethod(en-us,AX.60).gif xml Returns an XML string that represents the current object. (Inherited from Object.)
Gg923354.pubmethod(en-us,AX.60).gif Gg923354.static(en-us,AX.60).gif ::getQueryRowCount

Top

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.

Examples

In the following example, it is assumed that there is a query named Customer in the Microsoft Dynamics AX 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. 
    } 
}

Inheritance Hierarchy

Object Class
  ObjectRun Class
    QueryRun Class
      SysQueryRun Class