How can I define preset/static search criteria for the $where variable?
The $where variable is used as the WHERE clause in an sql SELECT statement to provide selection criteria when retrieving data from the database. This is used as an argument on the getData() method in all database table objects. By default when a task is activated from a menu screen it does not have any selection/search criteria, so it will select every available record on its particular database table. Selection criteria can subsequently be defined by pressing the SEARCH button in the navigation bar, which activates a SEARCH screen. This enables the user to enter whatever criteria is desired to filter the data so that only those records which match the selection criteria are displayed. In some cases it may be useful to have selection criteria which is preset for the task and which can be used without user intervention. Several methods are possible: • Insert selection criteria in the component script, as in: