Kbase P15497: DynCombo with fill-in parent fails
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  16/10/2008 |
|
Status: Unverified
FACT(s) (Environment):
Dynamics 2.0a
SYMPTOM(s):
DynCombo with fill-in parent fails
If a Dynamic Combo has a parent field that is another db field then all
works ok. If the parent field is is based on a variable then the combo fails
and the combo's query is not set correctly.
1. Build sdo and static viewer for order table
2. In viewer have fields ordernum and salesrep
3. Add a fill-in to the viewer (fiChar)
4. Make the salesrep field a dyncombo with the
following values:
Base Query:
FOR EACH salesrep
RepName = 1 for display seq
Parent Fields = fiChar
Parent Filter Query = salesrep.region = "&1"
5. In the initializeObject of the viewer add:
ASSIGN fiChar:SCREEN-VALUE IN FRAME {&FRAME-NAME} = "Central".
RUN SUPER.
MESSAGE fichar:SCREEN-VALUE IN FRAME {&FRAME-
NAME}.
RUN showQuery IN h_dyncombo. /* Code placed here
will execute AFTER standard
behavior. */
END PROCEDURE.
6. This should result in the combo listing
salesreps that have a region of
Central only (Dirk Pitt) however no salesreps are
displayed. As the call to showQuery demonstrates, the query is not being
set.
FIX:
------- Additional Comments From Mark Davies 2002-12-10 21:55 PST -------
Read section 4.4.5 of the old Dynamic Combo spec (pre V2) or read
section 4.9.5 of the new SmartDataField spec for V2+.
This explains why you are not seeing the expected results. Adding the value in the initializeObject does not mean that it will
still be there by the time DisplayFields are run - that value might
be cleared. Also the Dynamic combo is only initialised or refreshed
when running the DisplayFields procedure.
You need to make use of the refreshChildDependancies procedure to
apply your changed value to the query.
You could also make use of the debug functionality in the Dyncombo to
see your resolved query. Select the combo and press CNTRL-ALT-Q and
the resolved query of the combo will be displayed.
FIX:
Workaround for now is:
PROCEDURE displayFields:
/*--------------------------------------------------------------------------
----
Purpose: Super Override
Parameters:
Notes:
----------------------------------------------------------------------------
--*/
DEFINE INPUT PARAMETER pcColValues AS CHARACTER NO-UNDO.
DEFINE VARIABLE cSalesRep AS CHARACTER NO-UNDO. /* Add This Line */
/* Code placed here will execute PRIOR to standard behavior. */
RUN SUPER( INPUT pcColValues).
{get DataValue cSalesRep h_dynCombo}. /* Add This Line */
ASSIGN fiChar:SCREEN-VALUE IN FRAME {&FRAME-NAME} = "West".
RUN refreshChildDependancies IN h_dyncombo (INPUT "fiChar").
{set DataValue cSalesRep h_dynCombo}. /* Add This Line */
/* Code placed here will execute AFTER standard behavior. */
END PROCEDURE.