Query Class
The Query class embodies the structure of a query. Objects of this type are not used for fetching records from the database. Instead, use a QueryRun object that may be assigned a query object. The dynamic behavior of a query is defined by the QueryRun Class. The static behavior is defined by the Query class.
Queries contain one or more data sources that correspond to tables in the database. The data sources are specified by using QueryBuildDataSource objects.
class Query extends TreeNode
|
Method |
Description |
|---|---|
|
Adds a data source to the top level of the query. | |
|
Creates a subnode to the tree node in the Application Object Tree (AOT). The type of subnode depends on where you are in the tree. The new node acquires the name that was passed as a parameter. (Inherited from TreeNode.) | |
|
This method is not supported in Microsoft Dynamics AX. If you need to add a subnode of this type, use the TreeNode.AOTaddSubNode Method instead. (Inherited from TreeNode.) | |
|
This method is not supported in Microsoft Dynamics AX. If you need to add a subnode of this type, use the TreeNode.AOTaddSubNode Method instead. (Inherited from TreeNode.) | |
|
Creates subnodes for extended data types and relations. (Inherited from TreeNode.) | |
|
(Inherited from TreeNode.) | |
|
Returns the ApplCodeDocType of the TreeNode object. (Inherited from TreeNode.) | |
|
(Inherited from TreeNode.) | |
|
Returns the resource ID of the bitmap of the tree node. (Inherited from TreeNode.) | |
|
Counts the number of child nodes that a given tree node has. (Inherited from TreeNode.) | |
|
Compiles this node and its subnodes. (Inherited from TreeNode.) | |
|
(Inherited from TreeNode.) | |
|
Deletes the tree node in the development layer that you are currently working in. (Inherited from TreeNode.) | |
|
Creates a copy of a specified tree node as a child to the TreeNode object. (Inherited from TreeNode.) | |
|
(Inherited from TreeNode.) | |
|
Opens the appropriate editor for this node. (Inherited from TreeNode.) | |
|
Finds the specified child node of this node. (Inherited from TreeNode.) | |
|
Retrieves the first child of the tree node. (Inherited from TreeNode.) | |
|
(Inherited from TreeNode.) | |
|
(Inherited from TreeNode.) | |
|
Returns a string containing the properties of the tree node. (Inherited from TreeNode.) | |
|
(Inherited from TreeNode.) | |
|
(Inherited from TreeNode.) | |
|
Returns the source code of this node. (Inherited from TreeNode.) | |
|
Inserts a node among the subnodes of this node. (Inherited from TreeNode.) | |
|
(Inherited from TreeNode.) | |
|
Indicates whether this node is from a file found in the "old" directory. (Inherited from TreeNode.) | |
|
(Inherited from TreeNode.) | |
|
Returns an object which can be used to traverse the child nodes of the tree node. (Inherited from TreeNode.) | |
|
(Inherited from TreeNode.) | |
|
Ensures that the object is loaded. (Inherited from TreeNode.) | |
|
Compiles this node and its subtree in the AOT, updating the cross-reference system. (Inherited from TreeNode.) | |
|
Writes text to the Application Object Tree (AOT) Message window. (Inherited from TreeNode.) | |
|
(Inherited from TreeNode.) | |
|
Returns the value of the name property of the node. (Inherited from TreeNode.) | |
|
Opens a new AOT tree window with the tree node as the root. (Inherited from TreeNode.) | |
|
Returns the next node on the same level as the tree node. (Inherited from TreeNode.) | |
|
Indicates whether the node is an application object. (Inherited from TreeNode.) | |
|
Returns the resource ID of the overlay in the AOT associated with this node. (Inherited from TreeNode.) | |
|
Returns the parent node of the tree node. (Inherited from TreeNode.) | |
|
Returns the previous sibling of this tree node. (Inherited from TreeNode.) | |
|
Refreshes the node with the latest changes to the .aod file. (Inherited from TreeNode.) | |
|
(Inherited from TreeNode.) | |
|
Reloads this node from the disk, if applicable. (Inherited from TreeNode.) | |
|
Compiles this node and its subtree in the Application Object Tree (AOT). (Inherited from TreeNode.) | |
|
Saves an Application Object Tree (AOT) node. The node is not saved to the database. (Inherited from TreeNode.) | |
|
(Inherited from TreeNode.) | |
|
(Inherited from TreeNode.) | |
|
(Inherited from TreeNode.) | |
|
Sets the source code of this node. (Inherited from TreeNode.) | |
|
Opens the property sheet (if not already open) and shows the properties for this node. (Inherited from TreeNode.) | |
|
Returns the tool tip associated with the tree node. (Inherited from TreeNode.) | |
|
(Inherited from TreeNode.) | |
|
Returns the internal string code for the element type used in projects. (Inherited from TreeNode.) | |
|
Retrieves the value of the UtilFileType enum for the TreeNode object. The UtilFileType indicates which kind of file the application object is stored in. (Inherited from TreeNode.) | |
|
Returns the application object ID, if applicable. (Inherited from TreeNode.) | |
|
Returns the application object layer of the tree node. (Inherited from TreeNode.) | |
|
Returns a bitmask that specifies which layers contain this element. (Inherited from TreeNode.) | |
|
(Inherited from TreeNode.) | |
|
Returns the handle of the tree node's parent, if applicable. (Inherited from TreeNode.) | |
|
Returns the application object type for this node (form, report, class). (Inherited from TreeNode.) | |
|
Cancels a previous method call to the Object.setTimeOut Method. (Inherited from Object.) | |
|
Gets or sets the name of the user that last changed the Query object. | |
|
Counts the number of data sources that pertain to the query. | |
|
Returns the child data source corresponding to the specified number. | |
|
Returns the total number of data sources for the query, including any embedded data sources. | |
|
Returns the data source that has the specified name. | |
|
Returns the data source specified by the data source number. | |
|
Returns the data source that has the specified table assigned to it. | |
|
Overridden. Evaluates whether one query is equal to another. | |
|
Retrieves a version of the tree node from a specified layer. (Inherited from TreeNode.) | |
|
Returns the timer handle for the object. (Inherited from Object.) | |
|
Retrieves the handle of the class of the object. (Inherited from Object.) | |
|
Determines whether the query is part of a report. | |
|
Specifies whether or not the query is interactive, such as showing a dialog box. | |
|
Determines the level of indentation of the specified data source. | |
|
Determines the tree level, in the hierarchy of data sources, of the data source assigned to the specified table. | |
|
(Inherited from TreeNode.) | |
|
Overridden. Creates a query object. | |
|
Creates a query that exists on the same Client/Server side as the source query. | |
|
Returns a string that contains the name of the new element. (Inherited from TreeNode.) | |
|
Releases the hold on an object that has called a wait method on this object. (Inherited from Object.) | |
|
Releases a lock on the object that was issued by a wait method on this object. (Inherited from Object.) | |
|
Determines whether the object is on a server. (Inherited from Object.) | |
|
Returns the instance that owns the object. (Inherited from Object.) | |
|
Packs the query into a container and returns that container, which can then be used when you create a query. | |
|
Returns the report in which the query is defined, if the report exists. | |
|
Indicates whether the query has been saved to the disk. | |
|
Sets up the scheduled execution of a specified method. (Inherited from Object.) | |
|
Returns the internal node type of this node. (Inherited from TreeNode.) | |
|
Deletes the application object in the object database, but does not delete the tree node itself. (Inherited from TreeNode.) | |
|
Overridden. | |
|
Exports this node and its subtree from the Application Object Tree (AOT). (Inherited from TreeNode.) | |
|
Returns the name of the tree node. (Inherited from TreeNode.) | |
|
Returns the unique path to the tree node within the Application Object Tree (AOT). (Inherited from TreeNode.) | |
|
Releases the tree node explicitly. (Inherited from TreeNode.) | |
|
Returns the current number of references (the value of the reference counter) that the object has. (Inherited from Object.) | |
|
Gets or sets whether the query is allowed to update the records it fetches. | |
|
Pauses a process. (Inherited from Object.) | |
|
Overridden. |
This class enables you to create, read, update, and delete X++ code and metadata. Make sure that the user has access to the development security key (SysDevelopment) before calling this API.
Queries are used when the user wants to modify the records fetched by, for example, a form. One or more ranges are often added to an existing data source. Ranges are specified by using queryBuildRange objects.
The following example creates a query object that is used to create a QueryRun object.
{
Query q = new Query (QueryStr(Cust));
// Use the query to build a queryRun object.
QueryRun qr = new QueryRun (q);
;
if ( hasSecurityKeyAccess(securityKeyNum(SysDevelopment),
AccessType::Edit) )
{
// Traverse some records.
while (qr.next())
{
// ...
}
}
}