Share via


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

Syntax

class Query extends TreeNode

Run On

Called

Methods

  Method Description
Gg913387.pubmethod(en-us,AX.60).gif addBaseQuery
Gg913387.pubmethod(en-us,AX.60).gif addCompanyRange
Gg913387.pubmethod(en-us,AX.60).gif addDataSource Adds a data source to the top level of the query.
Gg913387.pubmethod(en-us,AX.60).gif addHavingFilter
Gg913387.pubmethod(en-us,AX.60).gif addQueryFilter
Gg913387.pubmethod(en-us,AX.60).gif allowCheck
Gg913387.pubmethod(en-us,AX.60).gif allowCrossCompany
Gg913387.pubmethod(en-us,AX.60).gif allowHavingFilters
Gg913387.pubmethod(en-us,AX.60).gif allowQueryFilters
Gg913387.pubmethod(en-us,AX.60).gif AOTadd Creates a subnode to the tree node in the Application Object Tree (AOT). (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTaddExtendedDataType This method is not supported in Microsoft Dynamics AX. If you need to add a subnode of this type, use the instead. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTaddRelation This method is not supported in Microsoft Dynamics AX. If you need to add a subnode of this type, use the instead. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTaddSubNode Creates subnodes for extended data types and relations. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTaddXref (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTAllowEdit (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTbitmapId Returns the resource ID of the bitmap of the tree node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTchildNodeCount Counts the number of child nodes that a given tree node has. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTcompile Compiles this node and its subnodes. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTconfigure (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTdelete Deletes the tree node in the development layer that you are currently working in. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTDrop Creates a copy of a specified tree node as a child to the TreeNode object. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTDuplicate (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTedit Opens the appropriate editor for this node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTendXref (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTfindChild Finds the specified child node of this node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTfirstChild Retrieves the first child of the tree node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTfirstChildEx (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTgetExecutableLineCount Returns the number of executable lines of code for this node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTgetExecutableLines Returns the executable lines of code for this node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTGetModel (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTgetProperties Returns a string containing the properties of the tree node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTgetPropertiesExt (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTgetProperty (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTgetSource Returns the source code of this node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTIncludeInCompare (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTinsert Inserts a node among the subnodes of this node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTIsDirty (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTIsOld Indicates whether this node is from a file found in the old model store. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTIsPersisted Indicates whether this node has been persisted in the model store. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTIsProxyNode (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTiterator Returns an object which can be used to iterate the child nodes of the tree node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTKernelHelpType (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTLayer Returns the layer of the tree node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTLayers Returns a collection of the layers the tree node is defined in. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTload Ensures that the object is loaded. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTmakeXref Compiles this node and its subtree in the AOT, updating the cross-reference system. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTmessageLine Writes text to the Application Object Tree (AOT) Message window. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTMove (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTname Returns the value of the name property of the node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTnewWindow Opens a new AOT tree window with the tree node as the root. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTnextSibling Returns the next node on the same level as the tree node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTObjectNode Indicates whether the node is an application object. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOToverlayBitmapId Returns the resource ID of the overlay in the AOT associated with this node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTparent Returns the parent node of the tree node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTprevious Returns the previous sibling of this tree node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTrefresh Refreshes the node with the latest changes to the .aod file. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTregenerate (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTRename (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTrestore Reloads this node from the disk, if applicable. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTrun Compiles this node and its subtree in the Application Object Tree (AOT). (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTsave Saves an Application Object Tree (AOT) node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTSetModel (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTsetProperties (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTsetPropertiesExt (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTsetProperty (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTsetSource Sets the source code of this node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTshowProperties Opens the property sheet (if not already open) and shows the properties for this node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTtoolTip Returns the tool tip associated with the tree node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTToString (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTtypeStr Returns the internal string code for the element type used in XPO files. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif AOTUtilFileType Retrieves the value of the UtilFileType enumeration type for the TreeNode object. The UtilFileType indicates which kind of file the application object is stored in. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif applObjectId Returns the application object ID, if applicable. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif applObjectLayerMask Returns a bitmask that specifies which layers contain this element. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif applObjectOldLayerMask Returns a bitmask that specifies which layers contain this element in the baseline model store. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif cancelTimeOut Cancels a previous method call to the setTimeOut method. (Inherited from Object.)
Gg913387.pubmethod(en-us,AX.60).gif changedBy Gets or sets the name of the user that last changed the Query object.
Gg913387.pubmethod(en-us,AX.60).gif changedDate Gets or sets the date an application object was last changed.
Gg913387.pubmethod(en-us,AX.60).gif changedTime Gets or sets the time an application object was last changed.
Gg913387.pubmethod(en-us,AX.60).gif checkAuthorizationOnOpenRanges
Gg913387.pubmethod(en-us,AX.60).gif checkFieldAccess
Gg913387.pubmethod(en-us,AX.60).gif checkRangeParsingErrors
Gg913387.pubmethod(en-us,AX.60).gif childDataSourceCount Counts the number of data sources that pertain to the query.
Gg913387.pubmethod(en-us,AX.60).gif childDataSourceNo Returns the child data source corresponding to the specified number.
Gg913387.pubmethod(en-us,AX.60).gif clearAllFields
Gg913387.pubmethod(en-us,AX.60).gif clearBaseQueries
Gg913387.pubmethod(en-us,AX.60).gif clearCompanyRange
Gg913387.pubmethod(en-us,AX.60).gif clearGroupBy
Gg913387.pubmethod(en-us,AX.60).gif clearHavingFilters
Gg913387.pubmethod(en-us,AX.60).gif clearOrderBy
Gg913387.pubmethod(en-us,AX.60).gif clearQueryFilters
Gg913387.pubmethod(en-us,AX.60).gif createdBy Gets or sets the name of the user who created the application object.
Gg913387.pubmethod(en-us,AX.60).gif creationDate Gets or sets the date an application object was created.
Gg913387.pubmethod(en-us,AX.60).gif creationTime
Gg913387.pubmethod(en-us,AX.60).gif dataSourceCount Returns the total number of data sources for the query, including any embedded data sources.
Gg913387.pubmethod(en-us,AX.60).gif dataSourceName Returns the data source that has the specified name.
Gg913387.pubmethod(en-us,AX.60).gif dataSourceNo Returns the data source specified by the data source number.
Gg913387.pubmethod(en-us,AX.60).gif dataSourceTable Returns the data source that has the specified table assigned to it.
Gg913387.pubmethod(en-us,AX.60).gif dataSourceUniqueId
Gg913387.pubmethod(en-us,AX.60).gif description
Gg913387.pubmethod(en-us,AX.60).gif equal Evaluates whether one query is equal to another. (Overrides the equal Method.)
Gg913387.pubmethod(en-us,AX.60).gif exportXML
Gg913387.protmethod(en-us,AX.60).gif finalize
Gg913387.pubmethod(en-us,AX.60).gif findHavingFilterByField
Gg913387.pubmethod(en-us,AX.60).gif findQueryFilter
Gg913387.pubmethod(en-us,AX.60).gif forceNestedLoop
Gg913387.pubmethod(en-us,AX.60).gif forceSelectOrder
Gg913387.pubmethod(en-us,AX.60).gif form
Gg913387.pubmethod(en-us,AX.60).gif getCompanyRange
Gg913387.pubmethod(en-us,AX.60).gif getMostRestrictedQueryFilterStatus
Gg913387.pubmethod(en-us,AX.60).gif getNextUniqueId
Gg913387.pubmethod(en-us,AX.60).gif getNodeInLayer Retrieves a version of the tree node from a specified layer. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif getTimeOutTimerHandle Returns the timer handle for the object. (Inherited from Object.)
Gg913387.pubmethod(en-us,AX.60).gif getValidTimeStateDateRange
Gg913387.pubmethod(en-us,AX.60).gif getValidTimeStateDateTimeRange
Gg913387.pubmethod(en-us,AX.60).gif getValidTimeStateQueryType
Gg913387.pubmethod(en-us,AX.60).gif groupByField
Gg913387.pubmethod(en-us,AX.60).gif groupByFieldCount
Gg913387.pubmethod(en-us,AX.60).gif handle Retrieves the handle of the class of the object. (Inherited from Object.)
Gg913387.pubmethod(en-us,AX.60).gif hashKey (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif hasRangeOrFilter
Gg913387.pubmethod(en-us,AX.60).gif havingFilter
Gg913387.pubmethod(en-us,AX.60).gif havingFilterCount
Gg913387.pubmethod(en-us,AX.60).gif inReport Determines whether the query is part of a report.
Gg913387.pubmethod(en-us,AX.60).gif interactive Specifies whether or not the query is interactive, such as showing a dialog box.
Gg913387.pubmethod(en-us,AX.60).gif isCompositeQuery
Gg913387.pubmethod(en-us,AX.60).gif isPureUnionAll
Gg913387.pubmethod(en-us,AX.60).gif levelNo Determines the level of indentation of the specified data source.
Gg913387.pubmethod(en-us,AX.60).gif levelTable Determines the tree level, in the hierarchy of data sources, of the data source assigned to the specified table.
Gg913387.pubmethod(en-us,AX.60).gif literals
Gg913387.pubmethod(en-us,AX.60).gif makeCopy (Inherited from TreeNode.)
Gg913387.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.
Gg913387.pubmethod(en-us,AX.60).gif new Creates a query object. (Overrides the new Method.)
Gg913387.pubmethod(en-us,AX.60).gif newObject Creates a query that exists on the same Client/Server side as the source query.
Gg913387.pubmethod(en-us,AX.60).gif newObjectName Returns a string that contains the name of the new element. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif nextUniqueId
Gg913387.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.)
Gg913387.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.)
Gg913387.pubmethod(en-us,AX.60).gif objectOnServer Determines whether the object is on a server. (Inherited from Object.)
Gg913387.pubmethod(en-us,AX.60).gif orderByField
Gg913387.pubmethod(en-us,AX.60).gif orderByFieldCount
Gg913387.pubmethod(en-us,AX.60).gif origin
Gg913387.pubmethod(en-us,AX.60).gif owner Returns the instance that owns the object. (Inherited from Object.)
Gg913387.pubmethod(en-us,AX.60).gif pack Packs the query into a container and returns that container, which can then be used when you create a query.
Gg913387.pubmethod(en-us,AX.60).gif packInternals
Gg913387.pubmethod(en-us,AX.60).gif queryFilter
Gg913387.pubmethod(en-us,AX.60).gif queryFilterCount
Gg913387.pubmethod(en-us,AX.60).gif queryType
Gg913387.pubmethod(en-us,AX.60).gif recordLevelSecurity
Gg913387.pubmethod(en-us,AX.60).gif report Returns the report in which the query is defined, if the report exists.
Gg913387.pubmethod(en-us,AX.60).gif resetValidTimeStateQueryType
Gg913387.pubmethod(en-us,AX.60).gif saved Indicates whether the query has been saved to the disk.
Gg913387.pubmethod(en-us,AX.60).gif searchable
Gg913387.pubmethod(en-us,AX.60).gif setTimeOut Sets up the scheduled execution of a specified method. (Inherited from Object.)
Gg913387.pubmethod(en-us,AX.60).gif title
Gg913387.pubmethod(en-us,AX.60).gif toString Returns a string that represents the current object. (Overrides the toString Method.)
Gg913387.pubmethod(en-us,AX.60).gif treeNodeExport Exports this node and its subtree from the Application Object Tree (AOT). (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif treeNodeName Returns the name of the tree node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif treeNodePath Returns the unique path to the tree node within the Application Object Tree (AOT). (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif treeNodeRelease Releases the tree node explicitly. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif treeNodeType Retrieves an instance of a TreeNodeType class that provides reflection information for the tree node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif unpackInternals
Gg913387.pubmethod(en-us,AX.60).gif updateNodePermissions (Inherited from TreeNode.)
Gg913387.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.)
Gg913387.pubmethod(en-us,AX.60).gif userUpdate Gets or sets whether the query is allowed to update the records it fetches.
Gg913387.pubmethod(en-us,AX.60).gif utilElement Returns a UtilElements record that is related to the node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif utilIdElement Returns a UtilIdElements record that is related to the node. (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif validateNameCharacters (Inherited from TreeNode.)
Gg913387.pubmethod(en-us,AX.60).gif validTimeStateAsOfDate
Gg913387.pubmethod(en-us,AX.60).gif validTimeStateAsOfDateTime
Gg913387.pubmethod(en-us,AX.60).gif validTimeStateDateRange
Gg913387.pubmethod(en-us,AX.60).gif validTimeStateDateTimeRange
Gg913387.pubmethod(en-us,AX.60).gif version
Gg913387.pubmethod(en-us,AX.60).gif wait Pauses a process. (Inherited from Object.)
Gg913387.pubmethod(en-us,AX.60).gif xml Returns an XML string that represents the current object. (Overrides the xml Method.)
Gg913387.pubmethod(en-us,AX.60).gif Gg913387.static(en-us,AX.60).gif ::insert_recordset

Top

Remarks

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.

Examples

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); 
 
    // Traverse some records. 
    while (qr.next()) 
    { 
        // ... 
    } 
}

Inheritance Hierarchy

Object Class
  TreeNode Class
    Query Class
      SysQuery Class