Controlling the Search in Siebel Button That Does Online Lookup

The Online Lookup feature allows the user to connect to the Siebel Server, search for data, and then link this data to an object in the client. For example, assume the user must add a contact to a calendar entry but this contact does not reside in the set of contacts that Siebel CRM Desktop synchronized to the client. The user can use Online Lookup to search for this contact on the Siebel Server and then add it to the calendar entry in the client. The user clicks the Search in Siebel button in the CRM Desktop - SalesBook dialog box to start Online Lookup. For information about controlling how Siebel CRM Desktop pins objects that the Online Lookup feature locates, see Controlling How Siebel CRM Desktop Pins Objects.

The example in this topic adds Online Lookup for employee records.

To control the Search in Siebel button that does Online Lookup

  1. Add the data source that Online Lookup must use:

    1. Use an XML editor to open the data_sources.xml file.

    2. Locate the connector element.

    3. Add the following data source definition for employees to the element that you located in step b:

      <data_source name="Employee" scope="General">
        <type>Employee</type>
        <columns>
          <column sort_order="1" sort_mode="asc">First Name</column>
          <column sort_order="0" sort_mode="asc">Last Name</column>
          <column sort_order="2" sort_mode="asc">Position</column>
        </columns>
      </data_source>
      

      You can specify a set of columns in the columns section, including a sort mode of asc or desc and the sort order. For more information, see Setting the Scope for Online Lookup.

  2. Add the view definition that Online Lookup must use:

    1. Use an XML editor to open the views.xml file.

    2. Add the following definition for the employee view. Column headings contain the names of the resources that the package_res.xml file contains:

      <view id="employees:online_salesbook">
        <image_list>
            <res_id type="normal">type_image:User:16</res_id>
        </image_list>
        <columns>
          <column width="150" sort="asc">
            <heading type="string">head_first_name</heading>
            <field>First Name</field>
          </column>
          <column width="150">
            <heading type="string">head_last_name</heading>
            <field>Last Name</field>
          </column>
          <column width="200">
            <heading type="string">obj_position</heading>
            <field>Position</field>
          </column>
        </columns></view>
      
  3. Specify parameters for the object selector:

    1. Use a JavaScript editor to open the business_logic.js file.

    2. Locate the selectors section that starts with the following comment:

      // Selectors options
      
    3. Locate the following selector for the Employee object:

      scheme.objects.get_object("Employee").selectors_options = {
        "source": {
          "caption": "obj_employee_plural",
          "view_id": "employees:salesbook",
          "search_by": ["First Name", "Last Name"],
          "display_format": ":[:(Login Name):]",
          "data_source_type": "database",
          "allow_new": false
        }
      };
      
    4. Add the following online parameter that enables Online Lookup. The view_id parameter references the view name that you created in step 2:

      scheme.objects.get_object("Employee").selectors_options = {
        "source": {
        "caption": "obj_employee_plural",
        "view_id": "employees:salesbook",
        "search_by": ["First Name", "Last Name"],
        "display_format": ":[:(Login Name):]",
        "data_source_type": "database",
        "allow_new": false,
        "online": {
          "view_id": "employees:online_salesbook",
          "like_template": "*{keyword}*" 
        }
      }
      };
      
  4. Register the MVG control on the form that must include Online Lookup. In this example, you add Online Lookup for the Employee MVG control on the Activity form:

    1. Use a JavaScript editor to open the forms.js file.

    2. Locate the following function:

      activity_form_base(ctx)
      
    3. Locate the following code in the function that you located in step b:

      // Employee MVG
      register_mvg_dialog(ctx, "Employee", "ActionToEmployee", "btn_mvgEmployee", { 
      "use_autocomplete_list": false });
      

      For more information, see Registering MVG Controls.

    4. Add the following online_sb parameter to the code that you located in step c:

      // Employee MVG
      register_mvg_dialog(ctx, "Employee", "ActionToEmployee", "btn_mvgEmployee", {
      "use_autocomplete_list": false,
      "online_sb": new mvg_dialogs.online_sales_book()
      });
      
  5. Save all the JavaScript and XML files you modified and then restart the client.

  6. Test your work:

    1. Open any calendar entry in the client.

    2. Click the button for the Employee field.

    3. In the Activity Employees dialog box, click the SalesBook control.

    4. In the CRM Desktop - SalesBook dialog box, click Search in Siebel.

    5. In the CRM Desktop - online SalesBook dialog box, enter a wildcard search in the text window.

      For example, enter the following wildcard search:

      J*
      
    6. Make sure Siebel CRM Desktop populates the Siebel CRM - - online SalesBook dialog box with all employees that reside on the Siebel Server that match your wildcard search.