Jaa


QueryRun Class

Definition

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
Microsoft.Dynamics.AX.KernelInterop.ProxyBase
QueryRun
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)

Methods

__shouldCallNew(Type)
addPageRange()
addPageRange(Int64, Int64)
addPageRange(Int64)
addXppProxyReference(Type, Object) (Inherited from XppObjectBase)
allowCheck()
allowCheck(Boolean)
allowCrossCompany()
allowCrossCompany(Boolean)
applyValueBasedPaging()
applyValueBasedPaging(Common, Boolean)
applyValueBasedPaging(Common)
args()
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)
bulkNext()
bulkNext(Boolean)
Call(String, Object[], Type[], Object[]) (Inherited from XppObjectBase)
cancelTimeOut(Int32) (Inherited from XppObjectBase)
canPage()
canPage(Boolean, Boolean, Boolean)
canPage(Boolean, Boolean)
canPage(Boolean)
changed(Int32, Int32)
changed(Int32)

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

changedBy()

Gets or sets the name of the user who last changed the application object.

changedBy(String)
changedDate()

Gets or sets the date an application object was last changed.

changedDate(Date)
changedNo(Int32)
changedTime()

Gets or sets the time an application object was last changed.

changedTime(String)
createdBy()

Gets or sets the name of the user who created the application object.

createdBy(String)
createKernelClass(Object[], Type[], Object[]) (Inherited from XppObjectBase)
creationDate()

Gets or sets the date an application object was created.

creationDate(Date)
creationTime()
creationTime(String)
description()
description(String)
detach()

Allows focus to be switched between windows.

(Inherited from ObjectRun)
enablePositionPaging()
enablePositionPaging(Boolean)
enableValueBasedPaging()
enableValueBasedPaging(Boolean)
equal(XppObjectBase)

Determines whether the specified object is equal to the current object.

finalize()
form()
form(String)
get(Int32, Int32)
get(Int32)

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

getImpExpDataContractType()
GetIntPtr()
GetKernelInstanceUniqueId() (Inherited from XppObjectBase)
getNo(Int32)

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

getPageError(Boolean, Boolean, Boolean)
getPageError(Boolean, Boolean)
getQueryRowCount(Query, Int32)
getTimeOutTimerHandle() (Inherited from XppObjectBase)
getXppProxyReference(Type) (Inherited from XppObjectBase)
handle()
importable()
init()
interactive()
interactive(Boolean)
isDetached()

Communicates whether an ObjectRun.detach method call has been made on this object.

(Inherited from ObjectRun)
IsManagedValid()
isPositionPagingEnabled()
isQueryTimedout()
isValueBasedPagingEnabled()
kernelhandle()
KernelInstanceDisposed() (Inherited from XppObjectBase)
literals()
literals(Int32)
loadCsv(String)
loadXml(String)
MakeReflectionCall(String, Object[]) (Inherited from XppObjectBase)
name()

Gets or sets the name that is used in code to identify a form, report, table, query, or another Finance and Operations application object.

name(String)
newmethod() (Inherited from XppObjectBase)
newmethod(Object)

Initializes a new instance of the Object class.

newObject(Object)
next()

Retrieves the next record from the query.

nextUniqueId()
nextUniqueId(Int32)
notify() (Inherited from XppObjectBase)
notifyAll() (Inherited from XppObjectBase)
objectOnServer()
Obsolete.
(Inherited from XppObjectBase)
origin()
origin(Guid)
pack()
pack(Boolean)
prompt()

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

query()
query(Query)
queryType()
queryType(Int32)
recordLevelSecurity()
recordLevelSecurity(Boolean)
report()
reportRun()
reset()
run()

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

runAndPopulate(Query, Common, Map)
saved()
saveUserSetup()

Saves the user setup.

saveUserSetup(Boolean)
searchable()
searchable(Boolean)
setCursor(Common, Int32)
setCursor(Common)
setImportSession(Guid)
setQuerytimeout(Int32, Boolean)
setQuerytimeout(Int32)
setRecord(Common, Int32)
setRecord(Common)
setTimeOut(String, Int32, Boolean)
Obsolete.
(Inherited from XppObjectBase)
setTimeOut(String, Int32)
Obsolete.
(Inherited from XppObjectBase)
shred(Guid)
title()
title(String)
ToString()

Returns a string that represents the current object.

usageCount() (Inherited from XppObjectBase)
userUpdate()
userUpdate(Boolean)
VerifyKernelClass() (Inherited from XppObjectBase)
version()
version(Int32)
wait() (Inherited from XppObjectBase)
Xml() (Inherited from XppObjectBase)
Xml(Int32) (Inherited from XppObjectBase)

Applies to