Form Block Methods (inherits Block)

void gotoQueryRow ( number row )

Go to row by row number

Focus moves to the row specified, where the row number applies to the data returned by the database. The row number should be in the range 0 ... N where N is the number of rows in the block; moving to row N moves to a new, empty record, logically just beyond the extant records. The displayed data will be scrolled to bring the specified row into view.

number gotoQueryRowByKey ( any key )

Go to row by primary key

Moves focus to the row corresponding to the specified key, where the key corresponds to the unique column for the query (typically, a table primary key column). Should only be used where the records are returned from a single table (ie., not via a query which joins multiple tables), since with multiple tables it is ambiguous which unique column to use.

void doAction ( number action )

Perform block level action

The specified block action is performed, where the action is identified by the code argument. Actions are numbers, but are best accessed via RekallMain (for instance, RekallMain.actNext) or via a block object (for instance, block.actNext). In practice, it will almost always be more convenient to use on of the action methods (for instance, block.firstRecord()). The available actions are listed below:
actFirst Go to first record
actPrevious Go to previous record
actNext Go to next record
actLast Go to last record
actAdd Add a new record
actSave Save current record
actDelete Delete current record
actQuery Start a query
actExecute Execute a query
actCancel Cancel a quert
actReload Reload data
actSaveAsNew Save data as a new record
actSaveUnchecked Save data without checks

bool firstRecord ( )

Go to first record

Moves focus to the first record in the block. This is equivalent to block.doAction(block.actFirst).

bool previousRecord ( )

Go to previous record

Moves focus to the previous record in the block. If focus is already at the first record then no action occurs.

bool nextRecord ( )

Go to next record

Moves focus to the next in the block. If focus is already at the last record, then focus moves to a new empty record (which can be filled in and inserted into the database). If focus is already at this new record then no action takes place.

bool lastRecord ( )

Go to last record

Moves focus to the last record. This is the last record returned by the database, and not a new empty record.

bool addRecord ( )

Add a new record

Focus is moved to a new, empty record. The record is not actually added at this point; it will be inserted into the database when subsequently saved.

bool saveRecord ( )

Save current record

Changes made to the current record are saved to the database.

bool saveUnchecked ( )

Save current unchecked

This is the same as the saveRecord method, except that no control validity checks are performed. Note, however, that an error could still occur if the data was invalid at the database server.

bool deleteRecord ( )

Delete current record

The current record is deleted from the database, and focus moves to the next record. Note that after a deletion, records are in effect renumbered to account for the deleted record.

bool startQuery ( )

Start query

The block is set into query mode, equivalent to the user clicking the start query tool button. All displayed controls for the current row are cleared, and the user can then enter search terms prior to executing the query.

bool executeQuery ( )

Execute query

Executes a query started with the startQuery() method (or via the start query tool button or menu entry).

bool cancelQuery ( )

Cancel query

Cancels a query. All controls in the current row are returned to their state before the query was started.

void reload ( )

Reload data from database

Reloads records from the database. This is equivelent to startQuery immediately followed by executeQuery, without any search values being entered into any controls.

void saveAsNewRecord ( )

Save current record as new record

This is similar to the saveRecord method, except that the record is saved as a new record. In effect, data is copied into a new empty record, which is then saved.

list invalidControls ( number row, bool required, bool recurse )

Get list of invalid controls

The block is checked for any data controls in the specified row which do not contain valid values (ie., which would not pass the validation checks); and, if the recurse argument is true, any nested blocks. The result is a list of invalid controls. If all controls are empty then all are considered valid (ie., this is an empty record) unless the required argument is set.

list changedControls ( number row )

Get list of changed controls

Returns a list of data controls in the specified row whose value has changed, that is, data controls whose values differ from the value last retrieved from the database.

bool isInQuery ( )

Test is block is in query mode

Returns a true result is the block is in query mode, that is, between a start query and execute query.