About Data and Control Items
Data items correspond to table columns within the database. By manipulating a data item (a text item, for example), the operator can automatically affect data that is in the database.
Control items do not have any association with the database. When the operator manipulates a control item, data within the database is not affected unless the appropriate SQL statements are provided. In general, control items allow the operator to perform common application functions, such as navigating from one screen to another, and do not allow operators to modify database data.
Control items can also be used to do the following:
- Display totals, averages, rankings, and other summary information calculated
from values in data items and database tables.
- Accept input from operators that is required by the application, but that
is not stored in the database.
- Display "look-up values," that is, database values derived from
a different table.
When building a block, consider this:
- Data blocks can contain both data items and control items
For example, a data block might contain four data items that display queried
database values and a fifth item that displays calculated values but does
not correspond to any column in the database. The fifth item would be a control
item populated by an assignment statement in the trigger that does the calculation.
- Control blocks cannot contain data items
Because control blocks are not associated with the database, none of the items
they contain can be data items. (Control items may be populated with database
values by writing SQL statements in trigger code.)
- Buttons and chart items are always control items
Because buttons and chart items do not store values, they cannot relate to
columns in the database, and are always control items.
- The values of control items may be referenced in code, in the same fashion
as local and global variables.
Related topics
About Items
About creating items
About blocks on forms
Creating a Data Item