Siebel CRM Desktop for Microsoft Outlook Administration Guide > Customizing Picklists > Process of Creating Hierarchical Picklists >

Linking Fields and Testing Your Hierarchical Picklist


This task is a step in Process of Creating Hierarchical Picklists.

If the user chooses a value in the parent picklist, then this value filters the values that CRM Desktop displays in the child picklist. To set up this relationship in:

  • Siebel Tools. You set up a constraint on the pickmap.
  • Siebel CRM Desktop. You write a JavaScript function and then add it to the opportunity_form function in the forms.js file.

This opportunity_form function implements the business logic for the Opportunity form. The forms.js file includes a similar function for each form that Siebel CRM Desktop displays.

If you do not establish this relationship between the parent picklist and the child picklist, then the parent dropdown list displays Parent 1 and Parent 2 as options and the child dropdown list displays all four child values.

To link fields and test your hierarchical picklist

  1. Use a JavaScript editor to open the forms.js file.
  2. Locate the following section in the opportunity_form function:

    //FORM FUNCTIONS

  3. Add the following function to the section you located in Step 2:

    function on_parent_changed(initial)
    {
      var parent_val = initial === true?
      ctx.item_ex.get_property("JVD Hier Parent"):
      ctx.form.jvd_hier_parent.value;
      ctx.form.jvd_hier_child.items.filter =
       ctx.session.create_expression("Parent","eq", parent_val == null ||
       parent_val == ''? '' : parent_val);
    }

    Siebel CRM Desktop uses this function in the following ways:

    • If the user opens the form. CRM Desktop sets the search specification on the child dropdown list. The function gets the value for the parent field from the client.
    • If the user changes the value in the parent dropdown list. The function gets the value for the parent field from the object model.
  4. Add the following code immediately after the function you added in Step 3:

    on_parent_changed(true);

    If the user opens the form, then this code allows the function to get the value for the parent field from the client.

  5. Locate the following section in the opportunity_form function:

    //CONTROL EVENTS

  6. Add the following event connector to the section you located in Step 5:

    ctx.events.connect(ctx.form["jvd_hier_parent"], "changed", on_parent_changed);

    If the user changes the value in the parent dropdown list, then this event handler calls the function to get the value for the parent field from the object model. For more information, see Customizing Event Connectors.

  7. Upload and publish your work. Do Uploading and Testing Your Static Picklist.
  8. Test your work:
    1. Open the client and then navigate to the opportunity form.
    2. Make sure the form displays the following picklists:
      • Hier Parent
      • Hier Child
    3. Choose the Hier Parent picklist and make sure it includes the following values:
      • - None -
      • Parent 1
      • Parent 2
    4. Choose Parent 1 in the Hier Parent picklist.

      CRM Desktop should automatically change the value for the Hier Child picklist to Child 1 of Parent 1.

    5. Choose the Hier Child picklist and make sure it includes the following values:
      • - None -
      • Child 1 of Parent 1
      • Child 2 of Parent 1
    6. Choose Parent 2 in the Hier Parent picklist.

      CRM Desktop should automatically change the value for the Hier Child picklist to Child 1 of Parent 2.

    7. Choose the Hier Child picklist and make sure it includes the following values:
      • - None -
      • Child 1 of Parent 2
      • Child 2 of Parent 2
Siebel CRM Desktop for Microsoft Outlook Administration Guide Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.