Equinox Online Help - Language Reference - A to Z

Home

FindRecordLock

Applies to
SyntaxFindRecordLock OperatorExpression, Test1Expression [, Test2Expression, Test3Expression, Test4Expression]
Action[Statement] Finds a record and locks it.
ScopeOnly usable in forms or subtables.
Notes

This statement operates in the same way as the FindRecord statement, except that the located record is automatically locked (if not already locked by another user).

The arguments are identical to those used for the FindRecord statement.

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 the selected record was already locked,

ie the lock failed.

CategoryRecord location
See Also CountRecords, CurrentTableName, FindRecord, FindRecordLock, GroupFindRecord, IsLookup, IsRecord, IsSameRecord, Lookup, LookupWrite, SameRecord
Example

This method selects an index which is based on the customer name and then finds and locks a default record appropriate for a point-of-sale system.

SetIndex CustIdx
FindRecordLock EQ, "CASH"