Kbase P83959: Dyn: Errors when calling a PLIP during a LEAVE trigger and when saving a record fails
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  24/06/2004 |
|
Status: Unverified
FACT(s) (Environment):
Dynamics 2.1A
SYMPTOM(s):
Saving a record
Thin client (icfruntime)
Invalid widget-handle. Not initialized or points to a delete widget (3135)
initializeObject af/cod2/afmessaged.w (\dynamics21\gui\icf\af\cod2\afmessaged.r) at line 5599
getAppserverInfo af/cod2/afmessaged.w (\dynamics21\gui\icf\af\cod2\afmessaged.r) at line 5098
ASInfo af/cod2/afmessaged.w (\dynamics21\gui\icf\af\cod2\afmessaged.r) at line 4898
--> addHandle af/cod2/afmessaged.w (\dynamics21\gui\icf\af\cod2\afmessaged.r) at line 5976
"Cannot access the NAME attribute because the widget does not exist. (3140)
** ttHandle already exists with no "". (132)
CAUSE:
Known issue that can occur when calling a PLIP on AppServer during a widget LEAVE trigger and when a validation procedure returns an wanted error message to abort a record save.
The LEAVE trigger fires because the focus moves to the Dynamics message window (afmessaged.w), somehow as expected, but at this point afmessaged.w is still connected to the AppServer and is waiting for the message coming from the AppServer (Asynchronous call with WAIT-FOR). Calling the PLIP at this point disturbs the session, which becomes even disconnected from the AppServer.
Hence the following errors after closing the Dynamics message dialog:
SERVER <name> is not connected. (5451)
Invalid or inappropriate server handle specified for RUN adm2/lookup ... ON SERVER statement. (5453)
This scenario is a good example to understand that we should no longer use the obsolete LEAVE event. Indeed, it should never be used for validation (use Dynamics validation hook instead), and for other needs (like automatic calculation depending of widget being left) one should better use the RETURN trigger (enter key) or/and the ENTRY trigger on a likely next sibling widget (to avoid to press Return).
FIX:
If you really want to call a PLIP during a LEAVE trigger that could potentially fire when submitting a record, then you should catch fact the record is being saved (in validateFields of the viewer, or in submitRow of SDO => ask the data target SDV if it has some widgets with leave event that can call a plip with your own API's) to fire the LEAVE by program, and set a flag so the leave event procedure would not call the plip again (and reset the flag) when it fires. Of course, you will have to reset that flag at the end of the update process.