Upload
david-boukhors
View
194
Download
6
Embed Size (px)
Citation preview
How to make multi-level hierarchical picklists
In many projects, I have seen developers getting stuck whilst trying to implement a hierarchical Pick list over more than two levels.
Here is how to do it on 4 levels; the process can be extended to as many levels as you want.
1) Create the List Of Values
Here are the four lov types we are going to use:
Type Language VAL LICLOV_TYPE ENU SIEBEL_NOVA1 SIEBEL_NOVA1LOV_TYPE ENU SIEBEL_NOVA2 SIEBEL_NOVA2LOV_TYPE ENU SIEBEL_NOVA3 SIEBEL_NOVA3LOV_TYPE ENU SIEBEL_NOVA4 SIEBEL_NOVA4
Let’s create the following values with your language code, and active flag = Y:
Type VAL LIC Parent LIC High LowSIEBEL_NOVA1 A ASIEBEL_NOVA1 B BSIEBEL_NOVA2 A1 ASIEBEL_NOVA2 A2 ASIEBEL_NOVA2 B1 BSIEBEL_NOVA2 B2 BSIEBEL_NOVA3 A11 A11 A1 ASIEBEL_NOVA3 A12 A12 A1 ASIEBEL_NOVA3 A21 A21 A2 ASIEBEL_NOVA3 A22 A22 A2 ASIEBEL_NOVA3 B11 B11 B1 BSIEBEL_NOVA4 A111 A111 A11 A1 ASIEBEL_NOVA4 A112 A112 A11 A1 ASIEBEL_NOVA4 A121 A121 A12 A1 ASIEBEL_NOVA4 A211 A211 A21 A2 ASIEBEL_NOVA4 A212 A212 A21 A2 A
As you see, at level L, level L-1 value is repeated in Parent LIC column, level L-2 value is repeated in High column and level L-3 value is repeated in Low column. If you plan to use more than 4 levels you just have to create new column on S_LST_OF_VAL table and List Of Values Business Component.
2) Create the Picklists
We’ll need 4 different picklists, based on List Of Values Busines Component. PickList Siebel Nova1 is based on SIEBEL_NOVA1 Type Value etc… Bounded, Static, No Delete, No Insert, No merge and No Update values can be set to Y.
Name Business Component Type Value Type FieldPickList Siebel Nova1 List Of Values SIEBEL_NOVA
1Type
PickList Siebel Nova2 List Of Values SIEBEL_NOVA2
Type
PickList Siebel Nova3 List Of Values SIEBEL_NOVA3
Type
PickList Siebel Nova4 List Of Values SIEBEL_NOVA4
Type
3) Add a dummy field When user picks a value on level1 field we want level2, level3 and level4 field to be emptied.This can be achieved easily by adding a dummy field on List Of Values Business Component, and with some customization we’ll see on point 5.
Name Type Calculated Calculated ValueDummy DTYPE_TEXT Y “”
4) Create the fiels
Let’s do it on the Account Business Component. You can create 4 columns on S_ORG_EXT/S_ORG_EXT_X table or re-use some columns, depending on your current customization.
Name Type Join ColumnLevel1 DTYPE_TEXT S_ORG_EXT_X ATTRIB_01Level2 DTYPE_TEXT S_ORG_EXT_X ATTRIB_01Level3 DTYPE_TEXT S_ORG_EXT_X ATTRIB_01Level4 DTYPE_TEXT S_ORG_EXT_X ATTRIB_01
5) Configure the Pick Maps on Account Fields
Each level must be constrained by upper levels, and each time a user pick a value all lower levels must be set empty.
Level1 Pick Map
Field PickList Field Constrain SequenceLevel1 Value N 1Level2 Dummy N 2Level3 Dummy N 3Level4 Dummy N 4
Level2 Pick Map
Field PickList Field Constrain SequenceLevel1 Parent Y 1Level2 Value N 2Level3 Dummy N 3Level4 Dummy N 4
Level3 Pick Map
Field PickList Field Constrain SequenceLevel1 High Y 1Level2 Parent Y 2Level3 Value N 3Level4 Dummy N 4
Level4 Pick Map
Field PickList Field Constrain SequenceLevel1 Low Y 1Level2 High Y 2Level3 Parent Y 3
Level4 Value N 4
6) Test it!You can now add the four fields on any applet, for example SIS Account Entry Applet. Don’t forget to set RunTime=Y on each Control/List column.