This page contains information related to an old version of the a!queryRecordType() Function.
To take advantage of the latest features and improvements, we always recommend you use the latest version whenever possible. See the latest version's page for information about what's been changed.
a!queryRecordType_20r4( recordType, selection, filters, pagingInfo, fetchTotalCount )
Executes a query on a given record type and returns the result. This is an older version of the a!queryRecordType()
function, which has new functionality.
Keyword | Type | Description |
---|---|---|
|
RecordType |
A reference to a record type. You must reference the record type directly from the |
|
Any Type |
List of record fields to be retrieved from the query. Record fields must be directly referenced from the |
|
Any Type |
A single logical expression or a list of query filters can be provided to filter the results. Without a logical expression, a list of query filters will only return those records where all filters evaluate to true ( |
|
PagingInfo |
The paging and sorting configurations to apply when retrieving the record data. |
|
Boolean |
If set to |
The return type of a!queryRecordType
will be a Map data type with the following parameters:
success
(Boolean)data
(List of Record Maps)startIndex
(Integer)batchSize
(Integer)sort
(List of SortInfo)totalCount
(Integer)identifiers
(List of Integer or List of Text)errorCode
(Text)This map will have the same named fields as a DataSubset (so that it can seamlessly be cast to that type when being passed around your application) with the addition of "success" and "errorCode" fields, like results from an Integration object, so app developers can build error-handling into their applications.
a!queryRecordType
returns a query result even if a runtime error happened. In these cases the "success" field of the result would have a value of false and the "errorCode" field will return an Appian Error Code indicating what has happened. You can use these codes to decide what to do next in your application.
Error Code | Description | Usage |
---|---|---|
APNX-1-4205-038 | The user does not have access to this record type or the underlying data source. | This error code could be used to hide elements of an interface. |
APNX-1-4205-039 | This is a record type with sync enabled, and is currently unavailable due to a sync issue. | This error code could be used as a condition on which to query the data source instead of waiting for the sync issue to be resolved. |
APNX-1-4205-040 | The record type's data source could not be reached, or the query limit for that source has been reached. | While uncommon, for finicky data sources, this error code could be used to prevent an interface from breaking. |
a!queryRecordType
cannot be larger than 5000
, and cannot be -1
.sortInfos
is not yet available for process-backed record types.Note: This uses the record type "Customer" for the purpose of illustration only. If you copy and paste the expression below into the Expression Rule Interface, it will not evaluate in your Test Rules interface. Use it as a reference only.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
a!queryRecordType(
recordType: recordType!Customer,
selection: {
recordType!Customer.fields.Name,
recordType!Customer.fields.LogoID,
recordType!Customer.fields.Industry
},
filters: {
a!queryFilter(
field: recordType!Customer.fields.InactiveFlag,
operator: "=",
value: false
)
},
pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: 5000,
sort: {
a!sortInfo(
field: recordType!Customer.fields.UpdatedOn,
ascending: false
),
a!sortInfo(
field: recordType!Customer.fields.Name,
ascending: true
)
}
),
fetchTotalCount: true
)
a!queryRecordType_20r4
that returns a selection or aggregation of record data when querying a record type.Feature | Compatibility | Note |
---|---|---|
Portals | Partially compatible | Can be used with Appian Portals if it is connected using an integration and web API. |
Offline Mobile | Partially compatible | Can be used with offline mobile if it is loaded at the top of the form. |
Sync-Time Custom Record Fields | Incompatible | |
Real-Time Custom Record Fields | Incompatible | Custom record fields that evaluate in real time must be configured using one or more Custom Field functions. |
Process Reports | Incompatible | Cannot be used to configure a process report. |
Process Events | Incompatible | Cannot be used to configure a process event node, such as a start event or timer event. |
a!queryRecordType_20r4() Function