Consultor Eletrônico



Kbase P150355: 4GL/ABL: Error "Field: was not found with ?. Update Cancelled" when the user leaves SmartSelect bl
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   7/30/2009
Status: Unverified

SYMPTOM(s):

4GL/ABL: Error "Field: <Field-Name> was not found with ?. Update Cancelled" when the user leaves SmartSelect blank and selects Save

Field: <key-field-name>
<table-name> was not found with <display-field-name>: 0.

Updated Canceled.

When the KeyField for a smartSelect is different from the displayField and its value is 0(zero) unkown or a blank, the smartSelect value is validated when the record is saved.

FACT(s) (Environment):

If you edit the Instance Properties for the smartSelect and set 'Key Field' and 'Displayed Field' both to 'child_id', you won't get the error.
Windows
OpenEdge 10.1C

CAUSE:

Bug# OE00115159

FIX:

None at this time. A workaround is to override the SmartDataViewer validateFields procedure and delete the lookup handle from the field list using code along the following lines:
DEFINE INPUT-OUTPUT PARAMETER pcNotValidFields AS CHARACTER NO-UNDO.
/* Code placed here will execute PRIOR to standard behavior. */
DEFINE VARIABLE cTargets AS CHARACTER NO-UNDO.
{get ContainerTarget cTargets}.
DEFINE VARIABLE hTarg AS HANDLE NO-UNDO.
DEFINE VARIABLE hField AS HANDLE NO-UNDO.
DEFINE VARIABLE iCount AS INTEGER NO-UNDO.
DEFINE VARIABLE cTemp AS CHARACTER NO-UNDO.
/*Here you have to check if there are more than one smartSelect in the viewer,
and do another repeat for each smartSelect in which you need this validation*/
ASSIGN
hField = DYNAMIC-FUNCTION('getSDFFrameHandle':U IN h_dynselect)
hField = hField:FIRST-CHILD:FIRST-CHILD.
DO iCount = 1 TO NUM-ENTRIES(cTargets):
hTarg = WIDGET-HANDLE(ENTRY(iCount,cTargets)).
IF hTarg = h_dynselect THEN DO:
IF NOT CAN-DO("?,0",hField:SCREEN-VALUE) THEN
cTemp = cTemp + (IF cTemp NE "" THEN "," ELSE "") + ENTRY(iCount,cTargets).
END.
END.
{set ContainerTarget cTemp}.
RUN SUPER( INPUT-OUTPUT pcNotValidFields).
/* Code placed here will execute AFTER standard behavior. */
{set ContainerTarget cTargets}.