Building a Query in X++
Views (146)
Queries contain many important elements. These elements have been discussed
in earlier courses in the context of the AOT. This section discusses these
elements from within the context of X++. Elements include datasources, ranges,
and sort fields which build upon each other.
There are two more classes to note before building a query:
• QueryBuildDataSource
• QueryBuildRange
QueryBuildDataSource
Data sources are what queries are built upon. They are arranged in a hierarchy
and define the sequence in which records are fetched from tables assigned to the
data source. The following example adds a data source to a query using X++:
Notice that the data source is an object, but the query object, 'query', requires a
method to add this data source to the query and assign the SalesTable to the data
source.
QueryBuildRange
A QueryBuildRange object is embedded within a data source of a query and
defines which records should be selected from the data source. A querybuild
range is built upon a QueryBuildDataSource object. The following example
uses the QueryBuildRange:
Best Regards,
Hossein Karimi
in earlier courses in the context of the AOT. This section discusses these
elements from within the context of X++. Elements include datasources, ranges,
and sort fields which build upon each other.
There are two more classes to note before building a query:
• QueryBuildDataSource
• QueryBuildRange
QueryBuildDataSource
Data sources are what queries are built upon. They are arranged in a hierarchy
and define the sequence in which records are fetched from tables assigned to the
data source. The following example adds a data source to a query using X++:
1 | Query query = new Query(); |
Notice that the data source is an object, but the query object, 'query', requires a
method to add this data source to the query and assign the SalesTable to the data
source.
QueryBuildRange
A QueryBuildRange object is embedded within a data source of a query and
defines which records should be selected from the data source. A querybuild
range is built upon a QueryBuildDataSource object. The following example
uses the QueryBuildRange:
1 | Query query = new Query(); |
Best Regards,
Hossein Karimi

Like
Report
*This post is locked for comments