Wednesday, January 28, 2009

How to create a Constraint PickList?

Today, I am going to share a very basic, and I would say a, "unique feature" in Siebel by which we can restrict values being displayed inside the PickList.

Here you go, "lets assume I need to create two fields a) Country b) State, on Opportunity business Component, along with their respective picklists, in such a way that system will display the list of States in the dropdown which belongs to the 'Country' selected in the Country Field."

Here below are the steps need to follow :

1. Check for the available columns (Characters Length: 30) in S_OPTY table, which is not being used by any of the field in Opportunity Business Component. Lets assume two fields for the purpose are ATTRIB_01, ATTRIB_02.

2. Create two PickLists for Country & State fields.
a) For Country
PickList Name : Country PickList
Project : Oppty
Bounded : TRUE
Business Component : PickList Generic
Static : TRUE
Type Field :
Type
Type Value : COUNTRY_LIST

b) For State
PickList Name : State PickList
Project : Oppty
Bounded : TRUE
Business Component : PickList Generic
Static : TRUE
Type Field :
Type
Type Value : STATE_LIST

3. Create LOV values in "Administration - Data -> List of Values" view, with the following values (I am assuming you know how to create LOV values)

a) For Country : (Type = COUNTRY_LIST)
Values = US, India

b) For State : (Type = STATE_LIST)
Values = Georgia, Ohio, Texas, NewYork, NewJersey (Put Description = US, for all)
Values = Uttar Pradesh, Madhya Pradesh, Karnatka, Gujrat (Put Description = India, for all)
4. Create two fields on Opportunity Business Component.
a) For Country
Name : Country
Column : ATTRIB_01
PickList : Country PickList

Country's Field PickMap
1. Field: Country
PickList Field: Value
Constrain: FALSE
b) State
Name : State
Column : ATTRIB_02
PickList : State PickList

State's Field PickMap
1. Field: State
PickList Field: Value
Constrain: FALSE

2. Field : Country
PickList Field : Desription
Constrain: TRUE
5. Create two fields on Opportunity List Applet :
a) For Country
Name : Country
Field : Country
Display Name - StringOverride : Country
Runtime : TRUE

b) For State
Name : State
Field : State
Display Name - StringOverride : State
Runtime : TRUE

6. Expose the two fields created on the Edit List webapplet layout of the Opportunity List Applet.

7. Compile the SRF with all the configuration done so far and see the magic on the UI.

Enjoyyyyyyy!!!!!

9 comments:

  1. Hai iam regular reader of this blog. can you give me more information we have requirement when new parent value is changed then child value must vanished in this case how do you do that.

    ReplyDelete
  2. Hi some more addition for this. I say chose html type is combo box. and parent picklist has search specification [Parent Id] IS NULL. AND WE CAN APPLY TO HIERARCHICAL PICKLIST. CHANGING BUSCOM TO PICKLIST HIERARCHICAL

    ReplyDelete
  3. Yes, you can change the Child Field to NULL when you select the Parent value from the dropdown.
    1. Create a Calc field in the Business Component of PickList Used. It will be either "PickList Generic" or "PickList Hierarchical".

    FieldName : Dummy
    Calculated : TRUE
    Calculated Value : ""

    2. Add the following record in Parent Field's pickmap :
    Field : <_Child Field Name>
    Picklist Field : Dummy

    Compile the SRF and see the change.

    ReplyDelete
  4. I proudly tell that i was learned lot of things from this blog . thank you very much mr Gaurav.
    I am grateful to you

    ReplyDelete
  5. Thank you so much Gaurav for the great post!!

    ReplyDelete
  6. Thank you it is a wonderful support, now to create a constraint picklist? is without a doubt simple and easy with the help of your information. Thanks

    ReplyDelete
  7. whats the difference between:
    1. Constraint PL and Hierarchical PL?I know that BC is different for both PL but what other difference?
    2. Also we can use single PL based on Picklist Generic BC and constraint that and it will work the same as you told in above example. So whats the difference between these all 3 type of PL?

    ReplyDelete