getRecordsForGridListing()
Overview
public struct function getRecordsForGridListing(
required string objectName
, required array gridFields
, numeric startRow = 1
, numeric maxRows = 10
, string orderBy = ""
, string searchQuery = ""
, any filter
, struct filterParams
, boolean draftsEnabled
, array extraFilters
, array searchFields
, boolean treeView = false
, string treeViewParent = ""
, boolean distinct = false
, boolean forceDistinct = false
)
Gets raw results from the database for the data manager grid listing. Results are returned as a struct with keys: records
(query) and totalRecords
(numeric count).
Note: any additional arguments passed will be passed on to the selectData() call.
Arguments
Name | Type | Required | Description |
---|---|---|---|
objectName | string | Yes | Name of the object whose records we are to get |
gridFields | array | Yes | Array of "grid fields", these will be converted to a selectFields array for the selectData() call |
startRow | numeric | No (default=1) | For pagination, first row number to fetch |
maxRows | numeric | No (default=10) | For pagination, maximum number of rows to fetch |
orderBy | string | No (default="") | Order by string for sorting records |
searchQuery | string | No (default="") | Optional search query |
filter | any | No | Optional filter for the selectData() call |
filterParams | struct | No | Optional params for the `filter` |
draftsEnabled | boolean | No | Whether or not drafts are enabled (if so, the method will additionally fetch the draft status of each record) |
extraFilters | array | No | Optional array of extraFilters to send to the selectData() call |
searchFields | array | No | Optional array of fields that will be used to search against with the `searchQuery` argument |
treeView | boolean | No (default=false) | |
treeViewParent | string | No (default="") | |
distinct | boolean | No (default=false) | |
forceDistinct | boolean | No (default=false) |