Tuesday, June 14, 2011

HOW TO CREATE A VALUE SET WHICH DEPEND ON OTHER VALUE SET

Here is an example of using :$FLEX$.Value_Set_Name to set up value sets where one segment depends on a prior segment that itself depends on a prior segment ("cascading dependencies"). Assume you have a three-segment flexfield where the first segment is car manufacturer, the second segment is car model, and the third segment is car color. You could limit your third segment's values to only include car colors that are available for the car specified in the first two segments. Your three value sets might be defined as follows:

Segment Name         Manufacturer
Value Set Name       Car_Maker_Name_Value_Set
Validation Table     CAR_MAKERS
Value Column         MANUFACTURER_NAME
Description Column       MANUFACTURER_DESCRIPTION
Hidden ID Column         MANUFACTURER_ID
SQL Where Clause     (none)

Segment Name         Model
Value Set Name       Car_Model_Name_Value_Set
Validation Table     CAR_MODELS
Value Column         MODEL_NAME
Description Column       MODEL_DESCRIPTION
Hidden ID Column         MODEL_ID
SQL Where Clause     WHERE MANUFACTURER_ID =
                     :$FLEX$.Car_Maker_Name_Value_Set

Segment Name         Color
Value Set Name       Car_Color_Name_Value_Set
Validation Table     CAR_COLORS
Value Column         COLOR_NAME
Description Column       COLOR_DESCRIPTION
Hidden ID Column         COLOR_ID
SQL Where Clause     WHERE MANUFACTURER_ID =
                     :$FLEX$.Car_Maker_Name_Value_Set
                     AND MODEL_ID =
                     :$FLEX$.Car_Model_Name_Value_Set

No comments:

Post a Comment