Blackbaud Internet Solutions > REST API (Advanced Donation Form and Images) > 3.0 > Class: QueryService

Class: QueryService

BLACKBAUD.api.QueryService Provides methods for retrieving query execution results from the CRM using calls to the BBIS REST services.

new QueryService(options)

Parameters
Name Type Description
options Object An object literal containing one or more of the following optional properties:
  • url : The URL of the BBIS site from which the data will be retrieved. This value is optional when accessed from a BBIS page. The default value will be the BBIS URL of the current page.
  • crossDomain : Indicates the BBIS url specified is from a separate domain than the current page. When True, the class will handle the complexities of making cross domain requests to retrieve data. The default value is False.

API.js, line 249

Methods

getResults(queryId, successCallback, failureCallback, filters)

Returns the result of executing the specified, published query. The query is executed as the last user to save the query. The results are cached and may be up to 10 minutes old. The results are limited to 5000 rows.

Parameters
Name Type Description
queryId String The Id of a query whose results should be returned.
successCallback function The function to call if the request succeeds. The function will be passed an object with the following properties:
  • Fields : An array of objects describing the fields returned from the query. The objects have have the following properties:
    • Name : The name of the column in the query.
    • Caption : The caption of the column defined in the query.
  • Rows : An array of objects describing the rows returned from the query. The objects have have the following properties:
    • Values : An array of the values returned for the row. The values are in the same order as the array of fields.
failureCallback function The function to call if the request fails.
filters Array An array of the filters to filter the results to rows that contain the specified value in the specified column. When specifying a column, use the name that is found in the query response. Depending on the type of column being filtered, the results may filter to rows that exactly match the specified value instead of those that contain the specified value. Summary columns such as MAX, MIN, and COUNT cannot be used as filters and will be ignored. The array should contain objects with the following properties:
  • columnName : The name of the column that should be used to filter the results.
  • value : The value that the specified column should be filtered by.

API.js, line 304