a!pagingInfo( startIndex, batchSize, sort )
Creates a value of type PagingInfo for use with grids, queries, and todatasubset()
.
See also: PagingInfo, Read-Only Grid, a!sortInfo(), a!queryRecordType()
Keyword | Type | Description |
---|---|---|
|
Integer |
Index of the array in which to start returning values for the subset. Valid values include those greater than zero. |
|
Integer |
The number of items to return. Valid values include those greater than or equal to -1. See Using the batchSize parameter for more information about the allowed values. |
|
SortInfo Array |
Valid values include |
PagingInfo
If the startIndex value is greater than the total number of items in the list the PagingInfo value is applied to, a null array is returned as the data.
This table shows the allowed batchSize values and what is returned when the function is evaluated.
batchSize value | Returns |
---|---|
-1 | All items are returned. This value is only supported in a!queryEntity(). |
0 or null | Only the totalCount and startIndex of the array are returned. This value is only supported in a!queryEntity(). |
>1 | Returns the specified number of results, starting at the startIndex. |
If the sort value is not null or empty, the function your PagingInfo is applied to returns a subset of the input sorted by the field value of the SortInfo. If the value is null or empty, it returns an unsorted subset of the input.
You can copy and paste these examples into the Expression Rule Designer to see how this works.
1
2
3
4
5
6
7
8
a!pagingInfo(
startIndex: 1,
batchSize: 4,
sort: a!sortInfo(
field: "name",
ascending: true()
)
)
returns
[startIndex=1, batchSize=4, sort=[field=name, ascending=true]]