QueryRun Class

The QueryRun class traverses tables in the database while fetching records that satisfy constraints given by the user, and helps gather such constraints from user input.

class QueryRun extends ObjectRun

Run On

Called

Methods

Method

Description

addPageRange

allowCheck

allowCrossCompany

applyValueBasedPaging

args

Returns the arguments that the object was constructed with. (Inherited from ObjectRun.)

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.)

cancelTimeOut

Cancels a previous method call to the Object.setTimeOut Method. (Inherited from Object.)

canPage

changed

Determines whether the specified data source has fetched a new value since the last call to the QueryRun.next method.

changedBy

changedDate

changedNo

changedTime

createdBy

creationDate

creationTime

detach

Allows focus to be switched between windows.

For example, a new form is created from an existing form by calling the new form's run method. Calling a run method changes the focus to the new form. Calling the detach method allows the user to return to the first form without closing the second form. (Inherited from ObjectRun.)

enablePositionPaging

enableValueBasedPaging

equal

Overridden.

form

get

Retrieves the record fetched by the previous call to next method.

getNo

Retrieves the record fetched by the previous call to QueryRun.next Method.

getTimeOutTimerHandle

Returns the timer handle for the object. (Inherited from Object.)

handle

Retrieves the handle of the class of the object. (Inherited from Object.)

init

interactive

isDetached

Communicates whether an ObjectRun.detach method call has been made on this object. (Inherited from ObjectRun.)

isPositionPagingEnabled

isValueBasedPagingEnabled

literals

lockedBy

name

new

Overridden.

newObject

next

Retrieves the next record from the query.

nextUniqueId

notify

Releases the hold on an object that has called a wait method on this object. (Inherited from Object.)

notifyAll

Releases a lock on the object that was issued by a wait method on this object. (Inherited from Object.)

objectOnServer

Determines whether the object is on a server. (Inherited from Object.)

owner

Returns the instance that owns the object. (Inherited from Object.)

pack

prompt

Presents the user with options for defining the records to be fetched by the query.

query

queryType

recordLevelSecurity

report

reportRun

reset

run

Opens a form used to obtain information about the query from the user, and fetches the matching records.

saved

saveUserSetup

Saves the user setup.

setCursor

setRecord

setTimeOut

Sets up the scheduled execution of a specified method. (Inherited from Object.)

title

toString

Overridden. Show a textual interpretation of the query.

usageCount

Returns the current number of references (the value of the reference counter) that the object has. (Inherited from Object.)

userUpdate

version

wait

Pauses a process. (Inherited from Object.)

xml

Returns an XML string that represents the current object. (Inherited from Object.)

Remarks

QueryRun objects are used to traverse tables in the database while fetching records that satisfy constraints given by the user. A QueryRun object may interact with the user to allow the user to 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 Class 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, while a Query object defines the static characteristics of the query.

Example

In the following example, it is assumed that there is a query named "Customer" in the AOT, and that it has one datasource, 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.
    }
}