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 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 saveAsNewRecord ( )

Save current record as new record

list invalidControls ( number row, bool recurse )

Get list of invalid controls