Equinox Online Help - Language Reference - A to Z

Home

FirstRecord

Applies to
SyntaxFirstRecord [LockExpression]
Action[Statement] Selects the first record in a table
ScopeOnly usable in forms or subtables
Notes

This statement selects the first record in the current index.

LockExpression allows you to control locking on the new record and may take one of the following values:

  • 0 The first record is selected and no lock is applied.
  • 1 The first record is selected and locked (if not already locked by another user).
  • 2 Equinox selects the first record that is not already locked by another user and locks it.

If LockExpression is omitted, it defaults to zero.

Note that you only need to lock a record if you intend to edit its fields. If you only want to read values, it is not necessary to lock it.

Also note that an applied lock is automatically released when a new record is selected. However, if required, you may manually release the lock before changing records, using the Unlock statement.

After the statement is executed, the SysError system workarea is set to one of the following values:

  • 0 The statement was executed successfully.
  • 1 An error occurred.
  • 2 This value is returned if LockExpression was set to 1, but the first record was already locked, ie the lock failed.
CategoryRecord navigation
See Also FindRecord, GroupFindRecord, GroupFirstRecord, GroupLastRecord, GroupNextRecord, GroupPreviousRecord, GroupSkipRecord, LastRecord, NextRecord, PreviousRecord, SkipRecord
Example

This example tests if the user is inserting or editing a record. If not, then the first record is selected.

if sysmode = ViewMode, NoMode then FirstRecord