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

NameTypeRequiredDescription
objectNamestringYesName of the object whose records we are to get
gridFieldsarrayYesArray of "grid fields", these will be converted to a selectFields array for the selectData() call
startRownumericNo (default=1)For pagination, first row number to fetch
maxRowsnumericNo (default=10)For pagination, maximum number of rows to fetch
orderBystringNo (default="")Order by string for sorting records
searchQuerystringNo (default="")Optional search query
filteranyNoOptional filter for the selectData() call
filterParamsstructNoOptional params for the `filter`
draftsEnabledbooleanNoWhether or not drafts are enabled (if so, the method will additionally fetch the draft status of each record)
extraFiltersarrayNoOptional array of extraFilters to send to the selectData() call
searchFieldsarrayNoOptional array of fields that will be used to search against with the `searchQuery` argument
treeViewbooleanNo (default=false)
treeViewParentstringNo (default="")
distinctbooleanNo (default=false)
forceDistinctbooleanNo (default=false)