Understanding the INPUT ARRAY instruction

The INPUT ARRAY dialog controls a list of records than can by directly edited.

INPUT ARRAY is designed to browse and modify a list of record, binding a static or dynamic array model to a screen array of the current displayed form.

Important: This feature is not supported on mobile platforms.

An INPUT ARRAY instruction supports additional features, built-in sort and search, multi-row selection and list modification triggers. For a detailed description of these features, see Table views.

Use the INPUT ARRAY instruction to let the end user update, delete and create new records in a list, after fetching a result set from the database. The result set is produced with a database cursor executing a SELECT statement. The SELECT SQL statement is usually completed at runtime with a WHERE clause produced from a CONSTRUCT dialog.

The INPUT ARRAY instruction associates a program array of records with a screen-array defined in a form so that the user can update the list of records. The INPUT ARRAY statement activates the current form (the form that was most recently displayed or the form in the current window).

During the INPUT ARRAY execution, the user can edit or delete existing rows, insert new rows, and move inside the list of records. The program controls the behavior of the instruction with dialog control blocks such as BEFORE DELETE, BEFORE INSERT, etc.

When the user clicks on an action view (button), or when an asynchronous event occurs, dialog interaction blocks like ON ACTION are executed.

The code inside an INPUT ARRAY dialog can use control instructions, dialog control functions, and the ui.Dialog class, to implement the dialog behavior.

To terminate the INPUT ARRAY execution, the user can validate (or cancel) the dialog to commit (or invalidate) the modifications made in the list of records.

When the statement completes execution, the program must test the INT_FLAG variable to check if the dialog was validated (or canceled) and then use INSERT, DELETE, or UPDATE SQL statements to modify the appropriate database tables. The database can also be updated during the execution of theINPUT ARRAY statement.