Block Methods (inherits Item)

number getNumRows ( )

Number of rows in associated query

Returns the number of rows in the query which provides data for the block. This is the number of rows returned by the database, plus (or minus) subsequent insertions or deletions.

number getQueryRow ( )

Get current query row number

Returns the row number (within the rows returned from the database. again plus or minus subsequent insertions or deletions) corresponding to the current row, that is, the row that has focus (in a form) or which is being processed (in a report).

string getRowValue ( string ctrlName, number rowNum )

Get value from associated query

This method returns the value for the specified column (identified by the corresponding control name) and row, where the row is the row number amongst the data returned by the database. This will usually be the same as the value displayed in a form (if the record is currently displayed). However, it will be different if the user has edited the displayed value but has not saved the change.

void setRowValue ( string ctrlName, number rowNum, string value )

Set value in associated query

The specified value is stored into the specified column (identified by control name) and row in the data returned by the database. Note that this will be overwritten if the user subsequently changes the value displayed in the corresponding control; also, the value will not be saved to the database unless the record is saved.

bool doAction ( number action )

Perform action in block

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

bool isInQuery ( )

See if query (find) is in progress

Returns a true result if the block is executing a query, eg., the user has clicked the start query tool button.

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 setUserFilter ( string filter )

Set filter for subsequent queries

Set a filter expression to be used in subsequent queries. This should be a valid SQL where expression, and will be used in the query in addition to any other filtering expressions.

void setUserSorting ( string sorting )

Set sorting for subsequent queries

Set an ordering expression to be used in subsequent queries. This should be a valid SQL order by expression, and will be used in the query in addition to (and after) any other ordering expressions.

bool overLimit ( )

Check if record fetch limit exceeded

If the query associated with the block had a record limit set, and the number of records (that would have been) retrieved exceeded the limit, then this method returns a true result.