Consultor Eletrônico



Kbase P15265: error 142 when user uses shortcut-keys
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   29/01/2003
Status: Unverified

SYMPTOM(s):

error 142 when user uses shortcut-keys

window with editable browse and E&xit button

leave triggers updating fields assuming the records are locked

CHOOSE button code releases all the records

CHOOSE button code calls APPLY CLOSE OF THIS-PROCEDURE

CAUSE:

when Alt-X is pressed, leave trigger is fired after choose trigger of exit button
because of APPLY CLOSE statement

FIX:

Detect if leave trigger is fired after choose trigger of Exit button and exit from "leave" block as soon as possible.
Example:
DEFINE VARIABLE exitInitiated AS LOGICAL NO-UNDO.

ON CHOOSE OF btnExit
DO:
exitInitiated = TRUE.

RELEASE <table>.

APPLY CLOSE TO THIS-PROCEDURE.
END.

ON LEAVE of colName IN BROWSE br-main
DO:
/* if Alt-X then leave asap */
IF exitInitiated THEN LEAVE.

/* the following line is generator for error 142 when Alt-X pressed */
ASSIGN <table>.<field> = anything.

END.