{dialog.object}computeSearchFromMetaDataAndFilterList Method
Syntax
{dialog.object}.computeSearchFromMetaDataAndFilterList(UXListName, optionsJSON, searchDataJSON);
Arguments
- UXListNamestring
The name of the List to search/sort.
- optionsJSONstring
A JSON object that contains the following search options:
- combineMultipleConditionsWithstring
If multiple search fields are specified should the conditions be combined with 'AND' or 'OR'. Defaults to 'AND'.
- debuggingboolean
Specifies whether or not debugging information be shown. Defaults to false.
- divstring
If optionsJSON.debugging is true, this property defines the name of the PLACEHOLDER control where the debugging information should be shown.
- searchDataJSONstring
A JSON object that defines the search definition. The following parameters are available:
- searchFieldstring
Name of field in SQL database to search on. Required
- searchFieldTypestring
The data type of field. Defaults to 'Character'
- searchControlValueAny Type
The value to search for. Required
- searchControlValueEndAny Type
The end of the range. Only required if rangeSearch is true. The type is the same type as the searchControlValue.
- rangeSearchboolean
Defaults to false. specify if the search is a range search. If true 'searchControlValue' is the start of the range and 'searchControlValueEnd' is the end of the range.
- searchOptionnumber
The type of search - defaults to 2 'Is Contained In'.
- searchOption
- Description
- 1
'Exact Match' (may or may not be case sensitive - depends on the database)
- 11
Case-insensitive 'Exact Match' (if underlying database is case-sensitive.)
- 2
'Is Contained In'
- 12
Case-insensitive 'Is Contained In' (if underlying database is case-sensitive.)
- 3
'Starts with'
- 13
Case-insensitive 'Starts with' (if underlying database is case-sensitive.)
- 4
'Wildcard' - user must explicitly enter wildcard characters '*', '%' or '?'. If QBE syntax is turned on, multiple wildcard criteria can be used, delimited with either a comma or && - use && to combine criteria with an AND clause. You can use negative values (e.g. -1,-2,-3 or -4) to invert the search result (e.g. 'not equals').
- 14
Case-insensitive 'Wildcard' (if underlying database is case-sensitive.)
- 20
Combine selections with OR. For multi-valued fields (e.g. Checkbox and Dropdownbox controls that allow multi-select) For example, if a Checkbox control has 'Red', 'Green' and 'Blue' as its choices, if you check 'Red' and 'Green' and select option 20, the search is for 'Red' or 'Green' in the field
- 201
Combine selections with OR and is 'Exact Match'.
- 202
Combine selections with OR and 'Is Contained In'.
- 203
Combine selections with OR and 'Starts With'.
- 21
Combine selections with AND. For example, if a Checkbox control has 'Red', 'Green' and 'Blue' as its choices, if you check 'Red' and 'Green' and select option 21, the search is for 'Red' and 'Green' in the field
- allowQBFboolean
Defaults to true. Specify if the search should use QBF syntax. e.g. If QBF syntax allowed, then 'searchControlValue' can be a comma delimited list of values
- advancedTrimCharFieldsForOracleboolean
Defaults to false. (Applies only to Oracle) In some cases Oracle treats trailing spaces in character fields as significant.
- sortExpressionstring
The field in the SQL database to sort on. Required
- directionstring
Defaults to ascending. Specify 'DESC' for descending sort.
Description
Performs a server-side query to filter/sort the data in a List based on a SQL data source.
Example
//Filter a List called 'LIST1' on the COUNTRY column for values 'USA', 'UK' or 'Canada' //and sort the result in descending order by COUNTRY. var arr = []; var searchObject = { searchControlValue: ['USA','UK','Canada'], searchField: 'COUNTRY' }; var sortObject = { sortExpression : 'COUNTRY', direction: 'DESC' }; arr.push(searchObject) //you can push multiple searchObjects onto the array arr.push(sortObject); //you can push multiple sortObjects onto the array var searchDataJSON = JSON.stringify(arr); var options = { } //use default values var optionsJSON = JSON.stringify(options) {dialog.object}.computeSearchFromMetaDataAndFilterList('LIST1',optionsJSON,searchDataJSON);