-
Notifications
You must be signed in to change notification settings - Fork 1
REST_CountRecords
Julio Carneiro edited this page Mar 14, 2020
·
8 revisions
The REST_CountRecords HTTP Request is used to calculate the number of records in a 4D Database Table that matches a given query string.
The POST request payload must include the following arguments/attributes:
- TableName: name of the table to get records from
- QueryString: a JS44D query string (see documentation here)
- FilterOptions: Record filter is also a JS44D query string, applied to the query results to further filter down the record selection to return
The Table name must be a valid table in the host database structure.
The JS44D QueryString is used to select the record count to return. To that selection the FilterOptions, if non empty, will be applied to eventually further reduce the selected record count.
Both QueryString and FilterOptions are documented in The JS44D Query String page.
The REST_CountRecords response is a JSON object with the following attributes:
- valid: true or false to indicate if the parameters given are valid or not
- selected: the total number of records selected, after applying the QueryString and the FilterOptions
- message: the error message returned by the request, in case 'valid' is false.
Here is a sample request:
And the response to the request above would look something like: