Consultor Eletrônico



Kbase P96806: assignNewValue publishes LookupComplete with empty pcNewScreenValue
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   27/10/2004
Status: Unverified

FACT(s) (Environment):

Dynamics 2.1A

SYMPTOM(s):

Called assignWidgetValue to change the value of a lookup

LookupComplete is fired for this lookup with empty value for the parameter pcNewScreenValue

Dynamics 2.1A03

CAUSE:


Knonw issue reported to development. Calling assignWidgetValue to change the value of a lookup has to fire LookupComplete so we can handle a child field linked to it. However, in this condition the value of parameter pcNewScreenValue is empty, although it should be equal to the displayedValue see on the UI at that time.
The explantion is in adm2/visual.p/assignWidgetValue that calls adm2/lookup.p/assignNewValue with a blank pcDisplayValue, which is then sent to LookupComplete.

FIX:

A solution is to send STRING(hLookup:INPUT-VALUE) to LookupComplete instead of pcDisplayValue, as shown bellow. This has been tested successfully in 2.1A03 and should not lead to any regression since it only affects the LookupComplete user event hook.
Modify adm2/lookup.p/assignNewValue to implement the following change at the bottom:
<pre>
[...]
IF AVAILABLE ttLookup AND
TRIM(ttLookup.cFoundDataValues) <> "":U THEN
/* 27-Oct-2004, problem with the 4th parameter pcDisplayFieldValue that is
blank when assignNewValue is called from assignWidgetValue.
Sending STRING(hLookup:INPUT-VALUE) instead solves the problem */
PUBLISH "lookupComplete":U FROM hContainer
(INPUT ttLookup.cFieldList, /* CSV of fields specified */
INPUT ttLookup.cFoundDataValues, /* CHR(1) delim list of all the values of the above fields */
INPUT cKeyFieldValue, /* the key field value of the selected record */
INPUT STRING(hLookup:INPUT-VALUE) /*was pcDisplayFieldValue*/ , /* the value displayed on screen (may be the same as the key field value ) */
INPUT cSavedScreenValue, /* the old value displayed on screen (may be the same as the key field value ) */
INPUT NO, /* YES = lookup browser used, NO = manual value entered */
INPUT TARGET-PROCEDURE /* Handle to lookup - use to determine which lookup has been left */
).
&SCOPED-DEFINE xp-assign
[...]
</pre>