Use the NO-ERROR and NO-WAIT options with the FIND statement.
When using FIND with EXCLUSIVE-LOCK NO-ERROR, if the record is already locked by another user then OpenEdge will raise error 2624 and wait until the record is released or the user cancels the operation.
The NO-ERROR option does not suppress the display of the error message 2624 when the record is locked unless the NO-WAIT option is used on the FIND.
The NO-WAIT option causes FIND to return immediately and raise an error condition if the record is locked by another user, unless the NO-ERROR option is used on the same FIND statement.To prevent both the raising of error 2624 and the display of the error message, the NO-ERROR and NO-WAIT options must be used together.Example:
REPEAT TRANSACTION:
FIND FIRST customer EXCLUSIVE-LOCK NO-ERROR NO-WAIT.
IF AVAILABLE customer THEN
DO:
UPDATE name.
LEAVE.
END.
END.