Kbase P39222: How to change the query of a lookup?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  8/27/2003 |
|
Status: Unverified
GOAL:
How to change the query of a lookup?
FIX:
Use the initializeLookup hook to refine the query before it is open
Progress Solution P39204 List of Dynamics Lookup Hooks
To do that, you will have to define initializeLookup procedure in the super procedure of the lookup with INPUT phLookup as HANDLE.
Note that if the INPUT parameter is not defined for this procedure (as reported in Dynamics 2.0A02), then you shall rely on TARGET-PROCEDURE for the handle of the lookup
You shall manage the context that the query will depend on, in user properties of the lookup (saved with setUserProperty or customer setMyProp functions in the lookup super procedure)
To manipulate the lookup query, you will have to use getBaseQueryString() and setBaseQueryString() to retrieve the query and update it. You should also save the original BaseQueryString in a userProperty (if property is blank, then save it with SetUserProperty). This way you will be able to reconstruct the query from the original.