Consultor Eletrônico



Kbase 18884: ADM2 - How to Update a Field That's Not in a SmartDataViewer?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/15/2008
Status: Verified

GOAL:

ADM2. How to Update a Field That's Not in a SmartDataViewer

GOAL:

Updating a field that is not in a SmartDataViewer

FACT(s) (Environment):

Progress 9.x

FIX:

If you are updating data on a SmartDataViewer and want to also update a field in the SmartDataObject that is not on your SmartDataViewer when you click the "Save" button on a SmartUpdatePanel, you can do the following:

In the SmartDataObject's submitRow function add code similar to the following prior to the standard behavior:

/* The following code assumes that whenever a record is updated we */
/* want to increase the CreditLimit field by 25%. This code checks */
/* to verify that we are updating a record and that the CreditLimit */
/* field is enabled in the SmartDataObject. */

IF getNewRow() = False AND columnReadOnly("CreditLimit") = False THEN
IF pcValueList <> "" THEN
/* Append New Data To Existing Modified Values */
ASSIGN pcValueList = pcValueList +
CHR(1) +
"CreditLimit" +
CHR(1) +
STRING(RowObject.CreditLimit * 1.25).
ELSE
/* No Existing Modified Values, Build List From Scratch */
ASSIGN pcValueList = "CreditLimit" +
CHR(1) +
STRING(RowObject.CreditLimit * 1.25).
ELSE
DO:
RUN addMessage("Cannot Modify Credit Limit","","").
RETURN False.
END.