Queries node

The Queries node is used to set up predefined queries for the mobile app. Each query can be added one or more menus. To add queries to menus, use the Menus node.

The Queries node can have one or more Category nodes and one or more Query nodes as children. The Queries node can have one attribute.

Attribute Description
MaxRecords Maximum number of records that queries will return. This is a global default that can be overridden for individual queries.

Category

You can use Category nodes to organize your queries. A Category node can have one or more other Category nodes and one or more Query nodes as children. Each Category node can have these attributes:

Attribute Description
Description Description of the category.
Id Identifier for the category.

Query

A Query node can be a child of a Category node or of the root Queries node. Each Query node can have these attributes:

Attribute Description
AccessItem List of permissions in Access Control that control access to this query. Specify one or more access IDs in a comma-separated list. Users must be assigned each of the specified permissions to have access to the query.
Default Indicates whether the query will be selected by default in any menu groupings in which it is included.
Description Description of the query
ID Unique identifier for the query
IsRouteQuery Indicates whether the query is routed.

See Routing.

LocalSQL SQL to use if the query is executed locally on the mobile device.
MaxRecords Maximum number of records that the query will return. This will override the default value defined on the root Queries element.
Model Model that the query uses. The value must match the ID of a model defined under the Models node.
Moniker Moniker of the business object that the query is associated with. Used to match Mobile models to Rest Services models.
OracleSQL Alternate SQL to use for Oracle databases.
ReferenceID Identifier of the Map Browser query in Infor Operations and Regulations that this mobile query will use. Not applicable for SQL queries. Can be used as an alternative to the ID attribute.
RunImmediate Indicates whether the query will run immediately when selected.
RunSqlRegex Indicates whether the system will run a regular expression before executing the query on a SQL Server database. The regular expression accounts for some of the most common differences between query syntax in Oracle and SQL Server.
  • Replace SYSDATE with GETDATE()
  • Replace NVL with ISNULL
  • Replace || with +
  • Remove UPPER
The default setting is True. To define a separate query for Oracle databases, you can also use the OracleSQL attribute. Note that this attribute is used for both SQL and Map Browser queries.
ServiceModels Comma-separated list of models in Rest Services that the query is associated with. If you specify a service model, then the query can access the properties defined for the service model.
SQL SQL to execute for an SQL query.
Type Type of query. Can be SQL or MapBrowser. For SQL queries, use the SQL attribute to specify the SQL. For Map Browser queries, use the ReferenceID attribute to specify the query to use.

Each Query node can have up to six children: AccessFilters, Filters, GIS, Parameters, QuickMaps, and Sorting.

AccessFilters

Access filters can be used to restrict access to specific types of records in the mobile app, such as specific application types or specific inspection types.

See Access filters.

The AccessFilters node has one or more AccessFilter nodes as children. Each AccessFilter node has these attributes:

Attribute Description
accessTemplate Access template that the filter will use. The template represents the path to a permission in Infor Operations and Regulations Access Control that must be granted to the user.
alias Unique identifier for the access filter. The alias is used to represent the access filter in the query SQL. When you add it to the SQL, enclose the alias in curly brackets, such as {alias}.

Filters

The Filters node is used to define filters that will be displayed in the Quick Filter section of the mobile app's action bar. Each filter is defined in a child Filter node. If you include a @FILTERS token in the query SQL, then the filters you define will be inserted at the position of the token. Otherwise filters are added to the end of the query.

Each Filter node can have these attributes:

Attribute Description
AccessItem List of permissions in Access Control that control access to this filter. Specify one or more access IDs in a comma-separated list. Users must be assigned each of the specified permissions to have access to the filter.
DisplayName Display name of the filter. This is the name that will be shown in the mobile app.
Enabled Set to True or False to enable or disable the filter.
Expression Expression that will be used to filter records. This can be used instead of the Predicate attribute if more advanced filtering is required.
ID Unique identifier for the filter.
LocalPredicate Predicate to use if the query is executed locally on the mobile device.
Predicate SQL defining the filter criteria.
Profiles List of profiles that have access to this filter. Specify one or more profile IDs in a comma-separated list.

GIS

You can use the GIS node to override global GIS settings for a particular query. The GIS node can have these attributes:

Attribute Description
Enabled Indicates whether GIS functionality is enabled for the query
GeocodeModel Model property to use for geocoding if X and Y coordinates are not provided.
LocalOnly Setting the value to True directs the query service to use the X and Y coordinates in the Infor Operations and Regulations database rather than getting the coordinates from the GIS service.
Note: Queries that filter by extent do not support searching on assets or records linked to assets when using local coordinates. Because of this limitation, the mobile app is not able to filter assets or associated records such as work orders and building applications.
ProximityBased Indicates whether the query is proximity-based. Proximity-based queries search for records withing a certain distance from the location of the mobile device.
ProximityDatasets Comma-separated list of viable datasets to use when performing proximity based queries.
QueryProximity Default proximity in which to search for spatial extent queries.

Parameters

The Parameters node is used to define any parameters that are expected by a given query. The Parameters node has one or more Parameter nodes as children. For SQL queries, you can define parameters in the SQL and then use Parameter nodes to set the values of the parameters. For example, in the Open Building Permits by Street Name query, the SQL includes a @StreetName parameter. StreetName is then used as the ID of the child parameter node.

Each Parameter node can have these attributes:

Attribute Description
DataType .NET data type of the parameter.
DefaultValue Default value of the parameter.
Filter Query used to show possible matches while the user is typing in the prompt.
ID Unique identifier for the parameter. For SQL queries, if you defined parameters in the SQL, then the ID should correspond to one of those parameters.
Moniker Moniker this parameter is associated with. Intended for code definition or predefined tables that can be easily matched.
Prompt Prompt that the mobile app will show when the user must enter a value for the parameter.
PromptAccessItem List of permissions in Access Control that control access to the prompt for this parameter. Specify one or more access IDs in a comma-separated list. The default value will be used for users who don't see the prompt.
PromptFormat Search type to use when filtering in the prompt. Can be set to Exact, StartsWith, or Contains. The default is Contains.
PromptProfiles Comma-separated list of profiles that have access to the prompt for this parameter. The default value will be used for users who don't see the prompt.
SearchFormat Search type to use for the parameter. Can be set to Exact, StartsWith, or Contains. The default is Contains.
Where WHERE clause to append at the end of the query. For SQL queries this attribute is optional. Required for Map Browser queries.

QuickMaps

You can use the QuickMaps node to map properties returned by the query to specific model properties. The QuickMaps node has one or more QuickMap nodes as children. Each QuickMap node has these attributes:

Attribute Description
ModelId Property that the query result is mapping to.
QueryId Select identifier in the SQL query.

Sorting

The Sorting node defines the different sort options for the query. When a user selects the query in the mobile app, the sort options are displayed under the "Sort by" section in the menu structure. Each sort option is defined in a child Sort node. If you include an @ORDERS token in the query SQL, then the sort options you define will be inserted at the position of the token. Otherwise the sort options are added to the end of the query.

Each Sort node can have these attributes:

Attribute Description
AccessItem List of permissions in Access Control that control access to this option. Specify one or more access IDs in a comma-separated list.
Default Indicates whether this is the default sort option for the parent query.
DisplayName Display name of the sort option. This is the name that will be shown in the mobile app.
Enabled Set to True or False to enable or disable the sort option.
Expression Expression that will be used to sort records. This can be used instead of the OrderBy attribute if more advanced sorting is required.
ID Unique identifier for the sort option.
LocalOrderBy SQL construct to sort by if the query is executed locally on the mobile device. If the current user's profile uses mixed lists, then the PropertyId attribute is used for sorting and this attribute is ignored.
OrderBy SQL construct to sort by. If the current user's profile uses mixed lists, then the PropertyId attribute is used for sorting and this attribute is ignored.
Profiles List of profiles that have access to this sort option. Specify one or more profile IDs in a comma-separated list.
PropertyId Property used to sort the query results in a mixed work list. If the current user's profile uses mixed lists, then the PropertyId attribute is used for sorting and the LocalOrderBy and OrderBy attributes are ignored.