Consultor Eletrônico



Kbase P4671: How to Set the WHERE clause of a SmartDataObject within a Sm
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   25/11/2003
Status: Verified

GOAL:

How to Set the WHERE clause of a SmartDataObject within a SmartBusinessObject

FACT(s) (Environment):

Progress 9.x

FIX:

1) Create an override procedure to initalizeObject in the main window.
2) Before RUN SUPER add the following string:

/* This stops the SBO from opening the SDO queries upon initalization */
DYNAMIC-FUNCTION('setOpenOnInit':U IN h_sboname, INPUT FALSE).

3) After RUN SUPER add the following code:

/* We do this after RUN SUPER so the SBO has been realized */

DEFINE VARIABLE SDOHANDLE AS HANDLE NO-UNDO.

/* Gets the HANDLE to the SDO in the SBO */
/* Replace SDOName with the name of the SDO */

ASSIGN SDOHANDLE = DYNAMIC-FUNCTION('dataObjectHandle':U IN h_sboname, "SDOName").

/* This sets the setQueryString in the SDO */

DYNAMIC-FUNCTION('setQueryString':U IN SDOHANDLE, "FOR EACH Customer WHERE CustNum = 13").

/* Now we open the query with the new where statement */

DYNAMIC-FUNCTION('openQuery':U IN SDOHANDLE).