Consultor Eletrônico



Kbase 21188: ADM2 -- How To Update Fields Without Using Update SmartPanel
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Unverified

GOAL:

ADM2. How to update records without using the ADM2 Update SmartPanel.  This alternate method uses instead the ADM2 procedures which are involved in the update transaction.

GOAL:

You want to omit the Update SmartPanel from your SmartObject application design

FACT(s) (Environment):

Progress 9.x

FIX:

Use this method when your SmartObject application design needs to omit the Update SmartPanel.

The updateMode procedure starts the 'update' behavior in the SmartObject just as the addRecord procedure starts the 'add' record behavior in the SmartObject.

The updateMode is an internal procedure of datavis.p super procedure and is executed by a SmartDataViewer (SDV) or a SmartDataBrowser (SDB).  This procedure has defined a character input parameter that can have one of two values; 'updateBegin' or 'updateEnd'.

In order to start an update record manually, the updateBegin value must be passed to the updateMode procedure.  Here is an example of the updateMode procedure:

   RUN updateMode IN <viewerHandle> (INPUT 'updateBegin':U).

When the 'updateBegin' value is passed as a parameter, the updateMode procedure enables the fields by running the enableFields procedure. After that, it sets the 'setDataModified' function value to 'yes', and this function executes some procedures to allow the update for the record.  Otherwise, when the 'updateEnd' value is passed as a parameter, the updateMode procedure just disables the fields in the viewer.  

In order to save the records, the updateRecord procedure also must be executed.  This example shows how to close the update mode.

   RUN updateMode IN <viewerHandle> (INPUT 'updateEnd':U).
  PUBLISH 'updateRecord':U.