Consultor Eletrônico



Kbase 19432: ADM2 - Use collectChanges to update a field not in SDV
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   1/20/2000

KnowledgeBase Number: 19432
Creation Date: 19-JAN-00
Modified Date:
This document applies to: Progress ADM2 Functionality
Version and Release Number: Version 9.0A and Higher

Summary: This Knowledgebase Entry describes how to use the
collectChanges procedure to update fields that are in an SDO, but not
on a Visual Object. While there are a couple of different methods
of doing this, the following describes how to use collectChanges to
accomplish this task. The procedure collectChanges(DataVis.p) is
called by default in the procedure stack that is called by the save
button on the SmartPanel.

CollectChanges has two INPUT-OUTPUT parameters:

1. pcChanges - Stores a CHR(1) separated list of field names and
their modifications. NOTE: These fields must be fields known to the
SDO's query.

2. pcInfo - Stores a comma separated list of information about the
changes, including "number of changes", "Page-Number", and the handle
of the procedure that submitted the changes.

Step by Step Details: Let's say you are adding a customer and want to
give customers in Massachussetts only a 15% discount. To do this, you
would code the following in a override procedure for collectChanges,
prior to RUN SUPER:

IF RowObject.State:SCREEN-VALUE IN FRAME {&FRAME-NAME} = "MA":U THEN
ASSIGN pcChanges = IF pcChanges = "":U THEN "Discount" + CHR(1) +
"15"
ELSE pcChanges + CHR(1) + "Discount" + CHR(1) +
"15"
pcInfo = IF pcInfo = "":U THEN "1" + "," +
STRING(DYNAMIC-FUNCTION('getObjectPage':U)) + "," +
STRING(THIS-PROCEDURE)
ELSE pcInfo + "," + "1" + "," +
STRING(DYNAMIC-FUNCTION('getObjectPage':U)) + "," +
STRING(THIS-PROCEDURE).