I want a user can retry to lock a record as following:
user 1 run:
User 2 run:
The code of User2 show "locked ¿Retry?" while User1 hold the record locked. But it happens that even if User1 release the record, the message "Locked ¿Retry?" still appears... the FIND CURRENT not aware that the record has been released
Is there any incorrect in the code?
If I replace FIND CURRENT CABEOFERV... for FIND CABEOFERV WHERE ... it work ok, but I can't ask for CURRENT-CHANGED cabeoferv
What can I do?
Thanks.
user 1 run:
Code:
FIND FIRST CABEOFERV EXCLUSIVE-LOCK NO-WAIT NO-ERROR.
MESSAGE "pausa" VIEW-AS ALERT-BOX.
RELEASE CABEOFERV.
Code:
DEFINE VARIABLE lRetry AS LOGICAL NO-UNDO.
FIND FIRST CABEOFERV NO-LOCK.
REPEAT:
FIND CURRENT CABEOFERV EXCLUSIVE-LOCK NO-WAIT NO-ERROR.
IF NOT AVAILABLE CABEOFERV THEN DO:
IF LOCKED CABEOFERV THEN DO:
MESSAGE "Locked ¿Retry?" VIEW-AS ALERT-BOX QUESTION BUTTON YES-NO UPDATE lRetry.
IF lRetry THEN do:
NEXT.
END.
ELSE
RETURN.
END.
ELSE DO:
MESSAGE "Deleted" VIEW-AS ALERT-BOX ERROR.
RETURN.
END.
END.
ELSE IF CURRENT-CHANGED CABEOFERV THEN DO:
MESSAGE "Modified" VIEW-AS ALERT-BOX INFORMATION.
RETURN.
END.
END.
The code of User2 show "locked ¿Retry?" while User1 hold the record locked. But it happens that even if User1 release the record, the message "Locked ¿Retry?" still appears... the FIND CURRENT not aware that the record has been released
Is there any incorrect in the code?
If I replace FIND CURRENT CABEOFERV... for FIND CABEOFERV WHERE ... it work ok, but I can't ask for CURRENT-CHANGED cabeoferv
What can I do?
Thanks.
Last edited by a moderator: