a!recordData() Function

This function references a set of records from a record type and allows additional filtering if necessary.

Syntax

a!recordData (recordType, filters)

Parameters

Keyword Type Description

recordType

RecordType

A reference to a record type, configured using the recordType! domain. For example, recordType!Case.

filters

Any Type

A single logical expression or a list of query filters, which are applied together with an AND operation, can be provided to apply additional filters to the record set. Queries also inherit the default filters defined on the referenced record type. You may only filter on fields from the referenced record type. Record types sourced from a web service or other expression do not support this parameter.

Returns

The a!recordData() function returns the RecordData data type.

Notes

  • The a!recordData() function is only supported in the data parameter of the read-only grid and charts.
  • Use the a!queryFilter() function or the a!queryLogicalExpression() function to define query filters in a!recordData().
  • When defining query filters in the a!recordData() function's filter parameter, you must reference fields from the source record type. Use a record type field reference to reference the field you want to filter by. For example, recordType!Employee.fields.department.
  • Filters do not work for record types that use a web service as the data source.

Example

NOTE: This expression uses the record type Employee for the purpose of illustration only. If you copy and paste the expression below into an expression, 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
31
32
33
34
35
36
37
38
39
40
41
42
   a!gridField(
     label: "Employees",
     /* Using the recordData function so we can filter out certain records. */
     data: a!recordData(
       recordType: recordType!Employee,
       filters: a!queryFilter(
         field: recordType!Employee.fields.title,
         /* This filter removes all records where "Manager" is found in the "Title" column. */
         operator: "<>",
         value: "Manager"
       )
     ),
     columns: {
       a!gridColumn(
         label: "ID",
         sortField: recordType!Employee.fields.id,
         value: fv!row[recordType!Employee.fields.id],
         align: "END",
         width: "ICON"
       ),
       a!gridColumn(
         label: "First Name",
         sortField: recordType!Employee.fields.firstName,
         value: fv!row[recordType!Employee.fields.firstName]
       ),
       a!gridColumn(
         label: "lastName",
         sortField: recordType!Employee.fields.lastName,
         value: fv!row[recordType!Employee.fields.lastName]
       ),
       a!gridColumn(
         label: "Department",
         sortField: recordType!Employee.fields.department,
         value: fv!row['recordType!Employee.fields.department]
       ),
       a!gridColumn(
         label: "Title",
         sortField: recordType!Employee.fields.title,
         value: fv!row[recordType!Employee.fields.title]
       )
     }
   )

See Also

  • Record Type: Additional information on the Record data type.
  • Record Type Object: Additional information on the record type object.
  • a!queryFilter() Function: Use the a!queryFilter() function to define filters in the a!recordData() or a!queryRecordType() functions before any grouping or aggregation is computed.
Open in Github Built: Fri, Sep 17, 2021 (04:03:56 PM)

On This Page

FEEDBACK