Siebel CRM Desktop for Microsoft Outlook Administration Guide > Customizing Siebel CRM Desktop > Overview of Customizing Siebel CRM Desktop >

Registering Form Controls


This topic describes how to register form controls. It includes the following topics:

If you add one of these controls, then you must register it.

Registering Autocomplete Controls

This topic describes how to register an autocomplete control. Note the following:

  • An autocomplete control is a type of control that displays a many-to-one relationship between the current object type and another object type. For example, between many opportunities and an account. It automatically displays objects in a drop-down list while the user enters characters in a field. For example, if the user enters the letters Big in the Account field of the Opportunity form, then Siebel CRM Desktop displays account names that start with Big, arranged in ascending alphabetic order. The user can then choose an account from this list.
  • An autocomplete list is a type of drop-down list that displays a many-to-many relationship between the current object type and another object type. For example, between parent opportunities and child contacts. It automatically displays child objects in a drop-down list while the user enters characters in a field. For example, if the user enters the letters Doe in the Contact field of the Opportunity form, then CRM Desktop displays a drop-down list that includes contact names that start with Doe, arranged in ascending alphabetic order. The user can then choose a contact from this list.

To view an example that registers an autocomplete control, see Modifying the Business Logic and Testing Your Work, and Defining the View. For an alternative to using an autocomplete control, see Configuring Autocomplete Lists and Primary Selectors for MVGs.

To register autocomplete controls

  1. Use a JavaScript editor to open the forms.js file.
  2. Locate the form handler you must modify.

    For more information, see Customizing Form Handlers.

  3. Add the following code to the form handler you located in Step 2:

    register_autocomplete_control(ctx, object_type, autocomplete_control, salesbook_button, options)

    where:

    • ctx is a default parameter. You do not modify this parameter.
    • object_type identifies the object type that CRM Desktop displays in the autocomplete control and in the SalesBook control.
    • autocomplete_control specifies the name of the autocomplete control that the form uses. The forms_xx.xml file defines this name.
    • salesbook_button specifies the name of the button control that the user clicks to open the SalesBook control.
    • options allows you to specify more options. For more information, see Including Options When Registering Autocomplete Controls.

      For example:

    register_autocomplete_control(ctx, "Account", "account_id", "btn_account_select", { "online_sb": new mvg_dialogs.online_sales_book() });

    This code does the following work:

    • Displays accounts in the autocomplete control
    • Uses account_id as the name of the autocomplete control that the form uses
    • Displays the btn_account_select button that the user clicks to open the SalesBook control
    • Uses options to specify other information.
Including Options When Registering Autocomplete Controls

You can include the following options when you register an autocomplete control:

  • online_sb. Displays the Online button in the SalesBook control.
  • sources. Defines options for an object that resides in the business_logic.js file.

You use the following format to add these options:

var custom_options =
{"option":value,"option":value}

where:

  • Curly brackets enclose the options.
  • A colon separates each option.
  • Double quotation marks (") enclose each key.
  • Values can reside in the form that a JavaScript object uses or in a JavaScript array.

For example, assume you specified to use the accounts:salesbook view in the SalesBook for an account. You specified this configuration in the options for the selector. Assume you must now configure Siebel CRM Desktop to use a custom SalesBook control for the account object. To do this, you can use the following code:

var account_options =
{
  "online_sb": new mvg_dialogs.online_sales_book(),
  "sources":[
    {
      "caption": "obj_account_plural_1",
      "view_id": "accounts:salesbook",
      "search_by": ["Name"],
      "allow_new": false,
      "online": {
        "view_id": "accounts:online_salesbook",
        "like_template": "*{keyword}*",
        "filter_fn": function(ctx, keywords_filter) { return keywords_filter; }
      }
    }
  ]
}

where:

  • account_options is a custom variable you create that contains the options. You can use this variable to register the function. You can also specify these options in the function that does the registration.
  • online_sb is the first option. The following value is predefined. You must not modify it:

    new mvg_dialogs.online_sales_book()

  • sources is the second option. You must specify the values for this option as a JavaScript array that includes the settings for the JavaScript object, such as caption and view_id.

Registering View Controls

This topic describes how to register a view control. To view an example that modifies the registration of a view control, see Removing Child Objects.

To register view controls

  1. Use a JavaScript editor to open the forms.js file.
  2. Locate the form handler you must modify.

    For more information, see Customizing Form Handlers.

  3. Add the following code to the form handler you located in Step 2.

    register_view_control_with_button(ctx, object_type, view_control, add_button, delete_button, unlink_button, options)

    where:

    • ctx is a required parameter. You do not modify this parameter.
    • object_type identifies the object type that CRM Desktop displays in the view.
    • view_control identifies the name of the view control that CRM Desktop displays in the form. The forms_xx.xml file defines this control.
    • add_button identifies the name of the button control that the user clicks to add a record.
    • delete_button identifies the name of the button control that the user clicks to delete a record.
    • unlink_button identifies the name of the button control that the user clicks to remove a link that links one record to another record. If the view displays child objects, then you must set unlink_button to the following value:

    null

    • options allows you to specify more options. You can specify options to register a view control the same way you specify options to register an autocomplete control. For more information about these options and the format you must use, see Including Options When Registering Autocomplete Controls.

      In addition to these options, it is recommended that you include the following option for every view you register. This option configures CRM Desktop to use custom view controls on an object form:

    {"custom_view_ctrl": true }

    For example:

    register_view_control_with_button(ctx, "Action", "activities_view", "btn_add_activity", "btn_remove_activity", null, {"custom_view_ctrl": true });

    This code does the following work:

    • Displays actions in the view
    • Displays the activities_view view control in the form
    • Displays the btn_add_activity button that the user clicks to add an activity
    • Displays the btn_remove_activity button that the user clicks to delete an activity
    • Sets unlink_button to null because the view displays child objects
    • Uses custom view controls on an object form

Registering MVG Controls

This topic describes how to register an mvg_dialog control. To view examples that use this control, see Controlling the Search in Siebel Button That Does Online LookupControlling the Pin Period for Contacts in the Activity Form, and Configuring Autocomplete Lists and Primary Selectors for MVGs.

To register MVG controls

  1. Use a JavaScript editor to open the forms.js file.
  2. Locate the form handler you must modify.

    For more information, see Customizing Form Handlers.

  3. Add the following code to the form handler you located in Step 2:

    register_mvg_dialog(ctx, object_type, primary_selector, show_dialog_button, options)

    where:

    • ctx is a required parameter. You do not modify this parameter.
    • object_type identifies the object type that CRM Desktop displays in the mvg_dialog control.
    • primary_selector specifies the name of the primary selector control that CRM Desktop displays in the mvg_dialog control. The forms_x.xml file defines this selector.
    • show_dialog_button identifies the name of the button control that the user clicks to open the MVG dialog box.
    • options allows you to specify more options. For more information, see Including Options When Registering MVG Controls.
Including Options When Registering MVG Controls

You can specify options to register an MVG control the same way you specify options to register an autocomplete control. For more information about these options and the format you must use, see Including Options When Registering Autocomplete Controls.

In addition to these options, you can include the following option:

"use_autocomplete_list": true

This option configures CRM Desktop to use an autocomplete_list control instead of a primary_selector control. If you use this option, then you must also modify the primary_selector control to use the autocomplete_list control in the form_xx.xml file.

The following example includes all the options that you can use when registering an MVG control:

var additional_contact_options = {
    "online_sb": new mvg_dialogs.online_sales_book(),
      "use_autocomplete_list": false,
      "sources":[
        {
          "caption": "obj_account_plural_1",
          "view_id": "contacts:salesbook",
          "search_by": ["Name"],
          "allow_new": false,
          "online": {
            "view_id": "contacts:online_salesbook",
            "like_template": "*{keyword}*",
            "filter_fn": function(ctx, keywords_filter) { return keywords_filter; }
          }
        }
      ]
    }
  
register_mvg_dialog(ctx, "Contact", "ActionToContact", "btn_mvgContact", additional_contact_options);

Siebel CRM Desktop for Microsoft Outlook Administration Guide Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.