practice flexfield 11

7
Copyright © Oracle Corporation, 2000. All rights reserved. Using Advanced Validation Capabilities Chapter 6 - Page 19 Practice 6-2 Copyright Oracle Corporation, 2000. All rights reserved. ® Practice 6-2 Practice 6-2 Using $FLEX$ to create cascading dependencies Using $FLEX$ to create cascading dependencies Practice 6-2 Instructions Scenario In this practice, you will create a descriptive flexfield that uses cascading dependencies to validate the values entered. The flexfield will track the manufacturer, model, and color of a vehicle. The possible model values will be restricted depending on the manufacturer value, and the possible color values will be restricted depending on the model value. To set up the cascading dependencies, you will create table-validated value sets using the following tables: CAR_MAKERS MANUFACTURER_ MANUFACTURER_ MANUFACTURER_ NAME DESCRIPTION ID Ford Ford 01 Nissan Nissan 02 Chevrolet Chevrolet 03 Chrysler Chrysler 04 CAR_MODELS MODEL_ MODEL_ MODEL_ MANUFACTURER_ NAME DESCRIPTION ID ID Mustang Mustang 011 01

Upload: varachartered283

Post on 20-Nov-2015

4 views

Category:

Documents


0 download

DESCRIPTION

Practice Flexfield 11

TRANSCRIPT

  • Copyright Oracle Corporation, 2000. All rights reserved.

    Using Advanced Validation CapabilitiesChapter 6 - Page 19

    Practice 6-2

    Copyright Oracle Corporation, 2000. All rights reserved.

    Practice 6-2Practice 6-2

    Using $FLEX$ to create cascading dependenciesUsing $FLEX$ to create cascading dependencies

    Practice 6-2 InstructionsScenarioIn this practice, you will create a descriptive flexfield that uses cascadingdependencies to validate the values entered. The flexfield will track themanufacturer, model, and color of a vehicle. The possible model values will berestricted depending on the manufacturer value, and the possible color valueswill be restricted depending on the model value.To set up the cascading dependencies, you will create table-validated value setsusing the following tables:CAR_MAKERSMANUFACTURER_ MANUFACTURER_ MANUFACTURER_NAME DESCRIPTION IDFord Ford 01Nissan Nissan 02Chevrolet Chevrolet 03Chrysler Chrysler 04

    CAR_MODELSMODEL_ MODEL_ MODEL_ MANUFACTURER_NAME DESCRIPTION ID IDMustang Mustang 011 01

  • Copyright Oracle Corporation, 2000. All rights reserved.

    Using Advanced Validation CapabilitiesChapter 6 - Page 20

    Windstar Windstar 012 01240SX 240SX 013 02Altima Altima 014 02Corvette Corvette 015 03Camaro Camaro 016 03Sebring Sebring 017 04Concorde Concorde 018 04

    CAR_COLORSCOLOR_ COLOR_ COLOR_ MODEL_ MANUFACTURER_NAME DESCRIPTION ID ID IDRed Red 0101 011 01Black Black 0102 011 01Green Green 0103 011 01Black Black 0104 012 01Blue Blue 0105 012 01White White 0106 012 01Champagne Champagne 0107 013 02Red Red 0108 013 02Sea Green Sea Green 0109 013 02Silver Silver 0110 014 02Gold Gold 0111 014 02Teal Teal 0112 014 02Black Black 0113 015 03Red Red 0114 015 03Yellow Yellow 0115 015 03Purple Purple 0116 016 03Blue Blue 0117 016 03Green Green 0118 016 03Maroon Maroon 0119 017 04Silver Silver 0120 017 04Green Green 0121 017 04White White 0122 018 04Blue Blue 0123 018 04Silver Silver 0124 018 04

    Step 1: Define Value SetsUse the Value Sets window to define three value sets.

    Define a table-validated value set named XX_MFG. Give the value set adescription, a format type of Char, and a maximum size of 10. Enablesecurity for the value set.

    Specify the table CAR_MAKERS as the validation table. Assign theValue column the column name MANUFACTURER_NAME, a type of

  • Copyright Oracle Corporation, 2000. All rights reserved.

    Using Advanced Validation CapabilitiesChapter 6 - Page 21

    Varchar2, and a size of 10. Assign the Meaning column the column nameMANUFACTURER_DESCRIPTION, a type of Varchar2, and a size of30. Assign the ID column the column name MANUFACTURER_ID, atype of Number, and a size of 2.

    Define a table-validated value set named XX_MODEL. Give the value seta description, a format type of Char, and a maximum size of 10. Enablesecurity for the value set.

    Specify the table CAR_MODELS as the validation table. Assign theValue column the column name MODEL_NAME, a type of Varchar2, anda size of 10. Assign the Meaning column the column nameMODEL_DESCRIPTION, a type of Varchar2, and a size of 30. Assignthe ID column the column name MODEL_ID, a type of Number, and asize of 3. Specify the following Where/Order By clause:

    WHERE MANUFACTURER_ID = :$FLEX$.XX_MFG Define a table-validated value set named XX_COLOR. Give the value set

    a description, a format type of Char, and a maximum size of 10. Enablesecurity for the value set.

    Specify the table CAR_COLORS as the validation table. Assign the Valuecolumn the column name COLOR_NAME, a type of Varchar2, and a sizeof 10. Assign the Meaning column the column nameCOLOR_DESCRIPTION, a type of Varchar2, and a size of 30. Assign theID column the column name COLOR_ID, a type of Number, and a size of4. Specify the following Where/Order By clause:

    WHERE MODEL_ID = :$FLEX$.XX_MODELORDER BY COLOR_NAME

    Step 2: Define the Structure (Segments)After defining your value sets, use the Descriptive Flexfield Segments windowto define the structure for your descriptive flexfield. For the purposes of thispractice, use the same descriptive flexfield that you worked on previously toenter your new structure. Unfreeze the flexfield definition first so that you canchange the structure.Delete the segments that you defined previously for the Global Data Elementscontext. Then define three new segments for the Global Data Elements context.

    Define a segment named Manufacturer, with a prompt of Manufacturer.Assign the segment the number 10, the column ATTRIBUTE1, and thevalue set XX_MFG.

    Define a segment named Model, with a prompt of Model. Assign thesegment the number 20, the column ATTRIBUTE2, and the value setXX_MODEL.

    Define a segment named Color, with a prompt of Color. Assign thesegment the number 30, the column ATTRIBUTE3, and the value setXX_COLOR.

    Ensure that all three segments are displayed and enabled. When you finishdefining the structure, freeze and compile your flexfield definition.

  • Copyright Oracle Corporation, 2000. All rights reserved.

    Using Advanced Validation CapabilitiesChapter 6 - Page 22

    After defining your value sets and segments, navigate to your descriptiveflexfield and test the results of your work. When you are finished, exit withoutsaving.

    Practice 6-2 SolutionsStep 1: Define Value Sets

    1 Navigate to the Value Sets window. System Administrator: (N) Application>Validation>Set2 Enter the information for the first value set in the following fields:

    Value Set Name: XX_MFG Description: XX Car Manufacturers Value Set Security Available: Selected Format Type: Char Maximum Size: 10 Validation Type: Table

    3 Click the Edit Information button to navigate to the Validation TableInformation window.

    4 Enter CAR_MAKERS as the table name.5 In the Table Columns region, enter the following information for the

    Value column: Name: MANUFACTURER_NAME Type: Varchar2 Size: 10

    6 In the Table Columns region, enter the following information for theMeaning column:

    Name: MANUFACTURER_DESCRIPTION Type: Varchar2 Size: 30

    7 In the Table Columns region, enter the following information for theID column:

    Name: MANUFACTURER_ID Type: Number Size: 2

    8 Save your work.9 Enter the information for the second value set in the following fields:

    Value Set Name: XX_MODEL Description: XX Car Models Value Set Security Available: Selected Format Type: Char Maximum Size: 10

  • Copyright Oracle Corporation, 2000. All rights reserved.

    Using Advanced Validation CapabilitiesChapter 6 - Page 23

    Validation Type: Table10 Click the Edit Information button to navigate to the Validation Table

    Information window.11 Enter CAR_MODELS as the table name.12 In the Table Columns region, enter the following information for the

    Value column: Name: MODEL_NAME Type: Varchar2 Size: 10

    13 In the Table Columns region, enter the following information for theMeaning column:

    Name: MODEL_DESCRIPTION Type: Varchar2 Size: 30

    14 In the Table Columns region, enter the following information for theID column:

    Name: MODEL_ID Type: Number Size: 3

    15 In the Where/Order By field, enterWHERE MANUFACTURER_ID = :$FLEX$.XX_MFG

    16 Save your work.17 Enter the information for the third value set in the following fields:

    Value Set Name: XX_COLOR Description: XX Car Colors Value Set Security Available: Selected Format Type: Char Maximum Size: 10 Validation Type: Table

    18 Click the Edit Information button to navigate to the Validation TableInformation window.

    19 Enter CAR_COLORS as the table name.20 In the Table Columns region, enter the following information for the

    Value column: Name: COLOR_NAME Type: Varchar2 Size: 10

    21 In the Table Columns region, enter the following information for theMeaning column:

    Name: COLOR_DESCRIPTION

  • Copyright Oracle Corporation, 2000. All rights reserved.

    Using Advanced Validation CapabilitiesChapter 6 - Page 24

    Type: Varchar2 Size: 30

    22 In the Table Columns region, enter the following information for theID column:

    Name: COLOR_ID Type: Number Size: 4

    23 In the Where/Order By field, enterWHERE MODEL_ID = :$FLEX$.XX_MODELORDER BY COLOR_NAME

    24 Save your work.Step 2: Define the Structure (Segments)

    1 Navigate to the Descriptive Flexfield Segments window. System Administrator: (N) Application>Flexfield>

    Descriptive>Segments2 Query your descriptive flexfield.3 Clear the Freeze Flexfield Definition check box.4 Select the Global Data Elements context and click the Segments

    button to navigate to the Segments Summary window.5 Delete the segments that you defined previously.6 Save your work.7 Enter the information for the first segment in the following fields:

    Number: 10 Name: Manufacturer Window Prompt: Manufacturer Column: ATTRIBUTE1 Value Set: XX_MFG Displayed: Selected Enabled: Selected

    8 Save your work.9 Enter the information for the second segment in the following fields:

    Number: 20 Name: Model Window Prompt: Model Column: ATTRIBUTE2 Value Set: XX_MODEL Displayed: Selected Enabled: Selected

    10 Save your work.

  • Copyright Oracle Corporation, 2000. All rights reserved.

    Using Advanced Validation CapabilitiesChapter 6 - Page 25

    11 Enter the information for the third segment in the following fields: Number: 30 Name: Color Window Prompt: Color Column: ATTRIBUTE3 Value Set: XX_COLOR Displayed: Selected Enabled: Selected

    12 Save your work.13 Navigate back to the Descriptive Flexfield Segments window.14 Select the Freeze Flexfield Definition check box.15 Click the Compile button to compile the flexfield definition.

    After defining your value sets and segments, navigate to your descriptiveflexfield and test the results of your work. When you are finished, exitwithout saving.