Consultor Eletrônico



Kbase 18453: ADM2: How To Reposition To A Record In A SmartDataObject Query
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/16/2009
Status: Verified

GOAL:

ADM2: How To reposition to a specific record in a SmartDataObject query

GOAL:

ADM2: How to reposition to a particular record in a SmartDataObject's (SDO) query.

FACT(s) (Environment):

Progress 9.X
Progress OpenEdge 10.x
Windows

FIX:

The example following allows you to enter a customer name, then reposition to that customer in the SmartDataObject's query, and refresh the visual object displaying customer data.

The SmartWindow contains the following:

- An SDO for customer table
- A SmartDataViewer (SDV) for customer table (it's data source is the SDO)
- A name search field and button to start the search

ON CHOOSE OF BtnSearch DO:
FIND FIRST Customer WHERE Customer.Name BEGINS NameSrch:SCREEN-VALUE NO-LOCK NO-ERROR.
IF AVAILABLE Customer THEN
DYNAMIC-FUNCTION('fetchRowIdent':U IN h_dcustomers, INPUT STRING(ROWID(Customer)), INPUT "").
END.
If you enter a customer name and choose the Search button, the SmartDataObject's query repositions to that customer and displays that customer's data in the SDV. The fetchRowIdent function accepts a comma separated list of database record ROWIDs for an SDO row that corresponds to the RowObject's RowIdent field. If the row is currently in the SDO temp-table, the SDO repositions to that record.
If the row is not in the temp-table, the database query repositions to that row and rebuilds the temp-table.