Kbase P58134: How to track changes for the updated fields in ADM2 ?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  12/8/2003 |
|
Status: Unverified
GOAL:
How to track changes for the updated fields in ADM2 ?
FACT(s) (Environment):
Progress 9.1D
FIX:
The following method overrides AssignDBRow procedure from Smart Data Object and
shows the updated fields, the old values and the new values.
Add your logic at the very end of this sample to track changes in the fields values.
PROCEDURE AssignDBRow:
/*------------------------------------------------------------------------------
Purpose: Super Override
Parameters:
Notes:
------------------------------------------------------------------------------*/
DEFINE INPUT PARAMETER phRowObjUpd AS HANDLE NO-UNDO.
DEF VAR hUpd AS HANDLE.
DEF VAR cUpd AS CHAR.
DEF VAR cBefore AS CHARACTER.
DEF VAR cAfter AS CHARACTER.
DEF VAR vi AS INTEGER.
DEF VAR hFld AS HANDLE.
ASSIGN hUpd = phRowObjUpd:BUFFER-FIELD('ChangedFields':U)
cUpd = hUpd:BUFFER-VALUE.
DO vi = 1 TO NUM-ENTRIES( cUpd ) :
hFld = DYNAMIC-FUNCTION('dbColumnHandle':U, ENTRY( vi, cUpd ) ).
cBefore = cBefore + ',' + hFld:BUFFER-VALUE .
END.
cBefore = SUBSTRING( cBefore, 2 ).
cAfter = DYNAMIC-FUNCTION('colValues':U, INPUT cUpd ) .
ENTRY( 1, cafter, CHR(1) ) = "".
cAfter = SUBSTRING( cAfter, 2 ).
cAfter = REPLACE( cAfter, CHR(1), ',' ).
/* Code placed here will execute PRIOR to standard behavior. */
RUN SUPER( INPUT phRowObjUpd).
/* Code placed here will execute AFTER standard behavior. */
MESSAGE cUpd SKIP
cBefore SKIP
cAfter SKIP
.
END PROCEDURE.