a!recordData() Function

Function

a!recordData( recordType, filters )

This function references a set of records from a record type and allows additional filtering in a read-only grid or chart that uses a record type as the source.

See also: Record Type Object, a!queryFilter()

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. When filtering, use only record fields or related record fields from the referenced record type. Record types sourced from a web service or other expression only support this parameter if the data is synced.

Returns

RecordData

Usage considerations

Supported use case

  • The a!recordData() function is only supported in the data parameter of the read-only grid and charts.

Using the filters parameter

  • When defining query filters, you must reference fields from the record type specified in the recordType parameter. 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]
       )
     }
   )
Open in Github Built: Tue, May 23, 2023 (06:12:33 PM)

On This Page

FEEDBACK