Consultor Eletrônico



Kbase 19453: Reposition an added record correctly in a SmartDataBrowser
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   1/26/2000
Reposition an added record correctly in a SmartDataBrowser

This Knowledge Base entry gives you a way to get around the standard behaviour of ADM2 (and ADM2.1) when adding a record to the data set.

Currently, when the Save button is pressed, the newly created record will end up at the end of the visualization of the query shown in the SmartDataBrowser (remember that this is the query on the RowObject Temp-Table), i.e. after the last record in the current data set.

Below is a description of how to get the newly added row into the correct spot in the visualization (the SmartDataBrowser).

Open up the source code of the SmartDataBrowser and add the following 2 lines to the Definitions section:

DEFINE VARIABLE rNewRecord AS CHARACTER NO-UNDO.
DEFINE VARIABLE hDataSource AS HANDLE NO-UNDO.

Then create an override procedure for updateRecord in the SmartDataBrowser and put the following piece of code after the RUN SUPER statement:

ASSIGN hDataSource = DYNAMIC-FUNCTION("getDataSource":U)
rNewRecord = DYNAMIC-FUNCTION("getRowident":U IN hDataSource).
DYNAMIC-FUNCTION("openQuery":U IN hDataSource).
DYNAMIC-FUNCTION("fetchRowIdent":U IN hDataSource, rNewRecord, "").


RDE - 26-Jan-2000