Consultor Eletrônico



Kbase 20664: ADM. How to save a disabled DB field properly in version 8.x ADM
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/5/2008
Status: Unverified

GOAL:

ADM. How to save disabled database fields placed on an ADM Version 8.x application screens

FACT(s) (Environment):

Progress 8.x

FIX:

When you work with SmartObjects, Progress provides you with the Application Development Model (ADM) architecture. It is
encapsulated in the standard source code for Progress Versions 8.x and 9.x with a significant design difference between those versions, but with the same goal.

The ADM methodology is composed of several internal procedures written by Progress that are used for communication between SmartObjects.
If you take a close look at the code of the ADM procedures that Progress runs when the saving process is being executed, you can see that Progress defines and manipulates a certain large amount of preprocessors. Two of those preprocessors are referenced in the code of the ADM-ASSIGN-STATEMENT procedure and have considerable importance in the saving process of the ADM architecture: ADM-TABLEIO-FIELDS and ADM-ASSIGN-FIELDS.

The adm-tableio-fields preprocessor:

The preprocessor is defined off of the enabled-fields preprocessor that contains a list of the enabled database fields that have been placed on a certain visual SmartObject of an application.

When you disable a database field that is included in a SmartViewer, for example, Progress automatically takes that field out of the enabled list that is used to define the enabled-fields preprocessor, and, consequently, the adm-tableio-fields preprocessor as well.

This behavior causes the disabled database field not to be saved to the database properly when the standard ADM saving process is performed.

The adm-assign-fields property:

A way to make the ADM code work correctly with such a disabled database field is to check the adm-assign-fields property of that field. You can check the property with the following steps:

1) Access the property sheet window of that field.

2) Choose the advanced button of that window.

3) Turn on the ADM-ASSIGN-FIELDS custom list property.

This tells Progress to include that disabled database field in the ADM-ASSIGN-FIELDS preprocessor definition. This makes the ADM-ASSIGN-STATEMENT procedure assign that field to the database automatically when the standard ADM saving process is executed once it runs the following statement at some point in its code:

ASSIGN FRAME {&FRAME-NAME}
             {&ADM-TABLEIO-FIELDS}
             {&ADM-ASSIGN-FIELDS} NO-ERROR.