Consultor Eletrônico



Kbase P26645: ADM-CURRENT-CHANGED does not notify the user that the curren
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   9/25/2003
Status: Unverified

FACT(s) (Environment):

Progress 8.2x

FACT(s) (Environment):

Progress 8.3x

FACT(s) (Environment):

Progress 9.x

SYMPTOM(s):

Running a SmartObjects Application.

Using the Progress ADM1 developing model.

Attempting to change the same record through different screens within the same session at the same time.

ADM-CURRENT-CHANGED does not display any warning message to the user when the record being changed has already been modified by the same user through a different program within the same Progress session.

CAUSE:

ADM-CURRENT-CHANGED verifies whether or not the current record has been modified by calling the CURRENT-CHANGED Progress 4GL function, which returns a value of FALSE if the current application changes the record, but no other user changes the record during its scope in the current application.

FIX:

This is how the ADM1 architecture was designed by Progress. However, if the desire of the Application developer is to provide the users with a different behavior allowing them to be able to change the same record through different Application Window programs within the same Progress session at the same time, then customization to the ADM1 is necessary. A valid idea is to make use of temp-tables to accomplish this functionality. For instance, if a customer SmartViewer object needs to detect that change through the use of a Smart Update Panel object in update mode, consider implementing the following code in the viewer:

/*** Definitions Section ***/
DEFINE TEMP-TABLE tt_cust NO-UNDO LIKE customer.
DEFINE VARIABLE vcFldsChanged AS CHARACTER NO-UNDO.

/*** Procedure Settings Section ***/
PROCEDURE local-enable-fields :
RUN dispatch IN THIS-PROCEDURE ( INPUT 'enable-fields':U ).
IF NOT adm-new-record THEN
DO:
CREATE tt_cust.
BUFFER-COPY customer TO tt_cust.
END.
END PROCEDURE.

PROCEDURE local-current-changed :
RUN dispatch IN THIS-PROCEDURE ( INPUT 'current-changed':U ).
IF AVAILABLE {&adm-first-enabled-table} AND
AVAILABLE tt_cust THEN
DO:
BUFFER-COMPARE {&adm-first-enabled-table} TO tt_cust
SAVE RESULT IN vcFldsChanged.
IF vcFldsChanged <> "":U THEN
DO:
MESSAGE SUBSTITUTE
("Sorry, this &1 has been changed. ",
"{&adm-first-enabled-table}") SKIP
"Please note any differences and re-enter your changes."
VIEW-AS ALERT-BOX.
RUN dispatch ('display-fields':U).
DELETE tt_cust.
UNDO, RETURN "ADM-ERROR":U.
END.
END.
END PROCEDURE.

PROCEDURE local-disable-fields :
RUN dispatch IN THIS-PROCEDURE ( INPUT 'disable-fields':U ).
IF AVAILABLE tt_cust THEN
DELETE tt_cust.
END PROCEDURE.