Record views are interfaces designed for displaying record information. Record views are created the same as any other interface.
This article illustrates a method for creating and configuring a record view for an entity-backed record. The entity-backed record is the most common record type, and the easiest to configure.
For record types whose data is sourced from a process, we recommend the process-backed record tutorial. For record types whose data is sourced from an expression, we recommend the expression-backed record tutorial.
To create a view for an entity-backed record, we'll need to do three things:
In order to send the interface the right information, you need to create a query to get the data for the selected record using a!queryEntity(). This requires a data store entity reference, which you'll create with a constant. See Using the Query Editor to learn how to easily set this up.
Once you're done, you should have an entity query for the fields you want to display. In the below example, you can see the query we created to return the columns we wanted to display in our record view.
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
a!queryEntity(
entity: cons!CASE_APP_OrderDataStoreEntity,
query: a!query(
selection: a!querySelection(
columns: {
! a!queryColumn(field: "OrderNum"),
! a!queryColumn(field: "OrderDate"),
! a!queryColumn(field: "TaxRate"),
! a!queryColumn(field: "ShippingCost"),
! a!queryColumn(field: "Status"),
! a!queryColumn(field: "Customer"),
! a!queryColumn(field: "ShippingAddress"),
! a!queryColumn(field: "id")
}
),
logicalExpression: a!queryLogicalExpression(
operator: "AND",
filters: {
a!queryFilter(
field: "id",
operator: "=",
value: ri!orderID
)
},
ignoreFiltersWithEmptyValues: true
),
pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: 50
)
),
fetchTotalCount: true
)
From the list of templates on the right, select One Column Form.
Click New Rule Input, then enter the Name of the input, and set the Type to the custom data type for your record.
In the below example, we titled our input Order and set the type to the custom data type for the order entity.
Click Test, and call the rule you created in the previous section in the Expression field. Make sure to call the rule with an ID for one of your records so we have some data with which we can preview the interface.
In the example below, we called our rule with record ID 10
.
Now you can add components to your interface to display your query results.
Here's what our simple interface preview looks like:
To learn more about creating interfaces, see Interface Recipe.
In the Record View Details section, under Views, click + New View.
Here's how we referenced our interface (OrderSimpleView) with our entity query (getOrderInfoByRecordID):
1
2
3
rule!OrderSimpleView(
rule!getOrderInfoByRecordID(rf!id)
)
In the above example, we pass the record ID with rf!id to the query we created, getOrderInfoByRecordID. The query runs and returns the record data, which is then passed to the interface, OrderSimpleView.
You can now save your changes and preview your record view. There's a shortcut to your record list at the top of the record type, in the Properties section; look for a link under Record List URL.