Consultor Eletrônico



Kbase 21720: ADM - How to know what fields were changed in a SmartViewer
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   29/01/2002
SUMMARY.
This knowledge base describes how to know what fields were changed in a SmartViewer when the update is finished.

EXPLANATION.
The code below shows how to know what fields were changed using the MODIFIED property. This code should be added in the local-update-record internal procedure.

NOTE: This code could be used in version 9x too, but procedures like collectChanges already have this information. In order to use this code in version 9x the following line should be changed:

IF LOOKUP("{&FIRST-EXTERNAL-TABLE}.":U + hField:NAME, "{&ENABLED-FIELDS}":U, " ") > 0

by

IF LOOKUP("RowObject.":U + hField:NAME, "{&ENABLED-FIELDS}":U, " ") > 0


DEFINE VARIABLE cFieldsModified AS CHARACTER NO-UNDO.
DEFINE VARIABLE hField AS HANDLE NO-UNDO.

ASSIGN hField = FRAME f-main:FIRST-CHILD
hField = hField:FIRST-CHILD.

REPEAT:

ASSIGN hField = hField:NEXT-SIBLING.

IF NOT VALID-HANDLE(hField) THEN LEAVE.

IF LOOKUP("{&FIRST-EXTERNAL-TABLE}.":U + hField:NAME, "{&ENABLED-FIELDS}":U, " ") > 0
THEN DO:
IF hField:MODIFIED THEN
ASSIGN cFieldsModified = cFieldsModified + (IF cFieldsModified NE "" THEN "," ELSE "") + hField:NAME.
END.
END.

MESSAGE cFieldsModified.