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 Lookup, Controlling 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:

    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 Siebel CRM Desktop displays in the mvg_dialog control.

    • primary_selector specifies the name of the primary selector control that Siebel 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.

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 Registering Autocomplete Controls.

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

"use_autocomplete_list": true

This option configures Siebel 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);