Siebel CRM Desktop for Microsoft Outlook Administration Guide > Customizing Siebel CRM Desktop > Customizing UI Behavior >
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 appointment but this contact does not reside in the set of contacts that 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 appointment 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 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
- Add the data source that Online Lookup must use:
- Use an XML editor to open the data_sources.xml file.
- Locate the connector element.
- 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.
- Add the view definition that Online Lookup must use:
- Use an XML editor to open the views.xml file.
- 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>
- Specify parameters for the object selector:
- Use a JavaScript editor to open the business_logic.js file.
- Locate the selectors section that starts with the following comment:
// Selectors options
- 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 } };
- 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}*" } } };
- 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:
- Use a JavaScript editor to open the forms.js file.
- Locate the following function:
activity_form_base(ctx)
- 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.
- 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() });
- Save all the JavaScript and XML files you modified and then restart the client.
- Test your work:
- Open any calendar appointment in the client.
- Click the button for the Employee field.
- In the Activity Employees dialog box, click the SalesBook control.
- In the CRM Desktop - SalesBook dialog box, click Search in Siebel.
- In the CRM Desktop - online SalesBook dialog box, enter a wildcard search in the text window.
For example, enter the following wildcard search:
J*
- Make sure CRM Desktop populates the Siebel CRM - - online SalesBook dialog box with all employees that reside on the Siebel Server that match your wildcard search.
Setting the Scope for Online Lookup
The scope attribute specifies the view mode that CRM Desktop uses to search records on the Siebel Server. It can include one of the following values:
- General.
- Deduplication.
- Not specified. CRM Desktop sets the scope to General.
CRM Desktop uses a different view mode to search for records in the employee example according to the following scope:
- General. CRM Desktop uses the Organization view mode.
- Deduplication. CRM Desktop uses the All view mode.
These values correspond to the following view mode that the siebel_meta_info.xml file specifies for the Employee object type: <object TypeId='Employee' Label='Employee' LabelPlural='Employees' EnableGetIDsBatching='true' IntObjName='CRMDesktopEmployeeIO' SiebMsgXmlElemName='Employee' SiebMsgXmlCollectionElemName='ListOfCRMDesktopEmployeeIO' > <viewmodes General="Organization" Dedup="All" />
|