TableResult Class

Contains the results of a search or query.

Namespace

DataSource

TableResult Properties

The following are properties for TableResult.

  • errorMessage
    Error message to display to the user.
  • queryMoreToken
    Query token that’s used for server-driven paging to determine and fetch the subsequent batch of results. This token is passed back to the Apex data source on subsequent queries in the queryMoreToken property on the QueryContext.​
  • rows
    Rows of data.
  • success
    Whether the search or query was successful.
  • tableName
    Name of the table that was queried.
  • totalSize
    The total number of rows that meet the query criteria, even when the external system is requested to return a smaller batch size.

errorMessage

Error message to display to the user.

Signature

public String errorMessage {get; set;}

Property Value

Type: String

queryMoreToken

Query token that’s used for server-driven paging to determine and fetch the subsequent batch of results. This token is passed back to the Apex data source on subsequent queries in the queryMoreToken property on the QueryContext.​

Signature

public String queryMoreToken {get; set;}

Property Value

Type: String

rows

Rows of data.

Signature

public List<Map<String,Object>> rows {get; set;}

Property Value

Type: List<Map<String, Object>>

success

Whether the search or query was successful.

Signature

public Boolean success {get; set;}

Property Value

Type: Boolean

tableName

Name of the table that was queried.

Signature

public String tableName {get; set;}

Property Value

Type: String

totalSize

The total number of rows that meet the query criteria, even when the external system is requested to return a smaller batch size.

Signature

public Integer totalSize {get; set;}

Property Value

Type: Integer

TableResult Methods

The following are methods for TableResult.

error(errorMessage)

Returns failed search or query results with the provided error message.

Signature

public static DataSource.TableResult error(String errorMessage)

Parameters

errorMessage
Type: String
Error message to display to the user.

Return Value

Type: DataSource.TableResult

The returned TableResult has these property values.
Property Value
success false
errorMessage errorMessage
tableName null
rows null
rows.size() 0

get(success, errorMessage, tableName, rows, totalSize)

Returns a subset of data rows in a TableResult with the provided property values.

Signature

public static DataSource.TableResult get(Boolean success, String errorMessage, String tableName, List<Map<String,Object>> rows, Integer totalSize)

Parameters

success
Type: Boolean
Whether the search or query was successful.
errorMessage
Type: String
Error message to display to the user.
tableName
Type: String
Name of the table that was queried.
rows
Type: List<Map<String, Object>>
Rows of data.
totalSize
Type: Integer
The total number of rows that meet the query criteria, even when the external system is requested to return a smaller batch size.

Return Value

Type: DataSource.TableResult

get(success, errorMessage, tableName, rows)

Returns a subset of data rows in a TableResult with the provided property values and the number of rows in the table.

Signature

public static DataSource.TableResult get(Boolean success, String errorMessage, String tableName, List<Map<String,Object>> rows)

Parameters

success
Type: Boolean
Whether the search or query was successful.
errorMessage
Type: String
Error message to display to the user.
tableName
Type: String
Name of the table that was queried.
rows
Type: List<Map<String, Object>>
Rows of data.

Return Value

Type: DataSource.TableResult

get(queryContext, rows)

Returns the subset of data rows that meet the query criteria, and the number of rows in the table, in a TableResult.

Signature

public static DataSource.TableResult get(DataSource.QueryContext queryContext, List<Map<String,Object>> rows)

Parameters

queryContext
Type: DataSource.QueryContext
Represents the query to run against a data table.
rows
Type: List<Map<String, Object>>
Rows of data.

Return Value

Type: DataSource.TableResult

get(tableSelection, rows)

Returns the subset of data rows that meet the query criteria, and the number of rows in the table, in a TableResult.

Signature

public static DataSource.TableResult get(DataSource.TableSelection tableSelection, List<Map<String,Object>> rows)

Parameters

tableSelection
Type: DataSource.TableSelection
Query details that represent the FROM, ORDER BY, SELECT, and WHERE clauses in a SOQL or SOSL query.
rows
Type: List<Map<String, Object>>
Rows of data.

Return Value

Type: DataSource.TableResult