Skip to main content

Db params

Criteria#

A criteria is an expression that is used to query field values to determine whether to include the record that contains each value.

Example:

fetchMap = {};fetchMap.put("criteria", [id > 0]);log Module("workorder").fetch(fetchMap);

Sort#

The sort order is used to sort the result-set in ascending or descending order. By default it sorts the data in ascending order. We can use the desc to sort the data in descending order and asc to sort in ascending order. The sort by fieldname is used to sort the result-set by the fieldname. The fieldname with respect to which sorting needs to be carried out, should be given.

Example:

fetchMap = {};fetchMap.put("criteria", [id > 0]);fetchMap.put("sortByFieldName", "id");fetchMap.put("sortOrder", "desc");log Module("workorder").fetch(fetchMap);

Offset#

The offset argument is used to identify the starting point to return rows from a result set.The offset value must be greater than or equal to zero. Offset is used to omit a specified number of rows before the beginning of the result set.


fetchMap = {};fetchMap.put("offset", 1);fetchMap.put("criteria", [id > 0]);log Module("workorder").fetch(fetchMap);fetchMap.put("offset", 6);                          log Module("workorder").fetch(fetchMap);

Limit#

The limit is used to set an upper limit on the number of records. There must be a non-negative integer for limit expression. It limits the number of records returned based on a limit value.

fetchMap = {};fetchMap.put("criteria", [id > 0]);fetchMap.put("limit", 5);                            log Module("workorder").fetch(fetchMap);                      fetchMap.put("limit", 10); log Module("workorder").fetch(fetchMap);

Field name#

A field name is is used to query field names to determine whether to include the fields. This is used to fetch specific fields.

Example:

fetchMap = {};fetchMap.put("criteria", [id > 0]);fetchMap.put("fieldName","id");log Module("workorder").fetch(fetchMap);