Consultor Eletrônico



Kbase P61842: Dynamic Combo and Dynamic Lookup API's do not work in the sa
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   1/19/2004
Status: Unverified

FACT(s) (Environment):

Dynamics 2.1A

SYMPTOM(s):

Dynamic Combo and Dynamic Lookup SetBaseQueryString API does not work in the same way.

SetBaseQueryString does not work for Dynamic Combos but works fine for Dynamic Lookups.

Dynamic Combos ignore changes to SetBaseQueryString.

The base query string of a Dynamic Combo cannot be changed.

CAUSE:

There is a difference between dynamic Lookup Objects and Dynamic Combos.

When a lookup is initialized and you select its button, its query is then opened according to the base query that has been set. With a dynamic combo the query has already been set and opened before InitializeObject, so if you want to affect the query you have to change it before the object is initialized.

FIX:

Use constructObject to change the query before the lookup is initialized. For example, in a constructObject override of the SmartDataViewer use:

DEFINE INPUT PARAMETER pcProcName AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER phParent AS HANDLE NO-UNDO.
DEFINE INPUT PARAMETER pcPropList AS CHARACTER NO-UNDO.
DEFINE OUTPUT PARAMETER phObject AS HANDLE NO-UNDO.

RUN SUPER (INPUT pcProcName, INPUT phParent, INPUT pcProplist, OUTPUT phObject).
IF phObject:TYPE = "PROCEDURE":U THEN
DO:
/* is it combo / lookup - has getSDFFileName */
IF LOOKUP("getSDFFileName", phObject:INTERNAL-ENTRIES) <> 0 THEN DO:
/* set query / label for address type combo · named ·dcgecat· */ IF DYNAMIC-FUNCTION("getSDFFileName":U IN phObject) =
"salesRepCombo":U THEN DO:
DYNAMIC-FUNCTION("setBaseQueryString":U IN phObject,
INPUT "FOR EACH salesRep WHERE salesrep.salesrep BEGINS 'B' NO-LOCK").
END. /* DYN-F("getSDFFileName ... */
END. /* IF LOOKUP("getSDFFIleName" .... */
END.