Oracle CRM On Demand Desktop Administration Guide > XML Files Reference > XML Code to Customize the SalesBook Control >

Example Code of the lookup_view_defs.xml File


This topic gives one example of code that you can use in the lookup_view_defs.xml file. You might use this feature differently, depending on your business model. The following code is an example of the lookup_view_defs.xml file:

<res_root>
   <array key="all_lookup_types">
      <item value="Account"></item>
      <item value="Contact"></item>
      <item value="Opportunity"></item>
   </array>
   <lookup_view_def key="lookup:contacts">
      <display name="Contacts"></display>
      <filter dasl="[http://schemas.microsoft.com/mapi/proptag/0x001A001E] &gt;= 'IPM.Contact.OnDemand.Contact' AND [http://schemas.microsoft.com/mapi/proptag/0x001A001E] &lt;= 'IPM.Contact.OnDemand.Contact'"></filter>
      <view id="contacts:salesbook"></view>
      <quick_lookup dasl_format="[http://schemas.microsoft.com/mapi/id/{00062004-0000-0000-C000-000000000046}/8005001E] = '%s'"></quick_lookup>
      <type id="Contact"></type>
   </lookup_view_def>
</res_root>

To use the recommended custom SalesBook control, which is the default, you do not require the lookup view definitions listed in lookup_view_defs.xml. Instead, add selectors_options to business_logic.js in the following format:

scheme.objects.get_object("Account").selectors_options = {
   "source": {
      "caption": "",
      "allow_new": false,
      "view_id": "",
      "search_by": [""],
      "data_source_type": "",
      "online": {
         "view_id": "contacts:online_salesbook",
         "like_template": "*{keyword}*"
      }
   }
}

where:

  • get_object. Indicates the name of the object for which you are adding selector options.
  • caption. The caption of the object that is displayed on the SalesBook dialog box. You must specify the caption as a reference name from package_res.xml.
  • allow_new. Enables or disables the Add button on the SalesBook dialog box. Possible values are True or False. If this parameter is not specified, then it is set to true by default.
  • view_id. The identifier of the view defined in the views.xml file, which is displayed on the SalesBook dialog box.
  • search_by. The name of the fields to search for in the SalesBook dialog box. You can enter several field names by separating them with a comma as in this example:

    "search_by": ["First Name", "Last Name"]

  • data_source_type. Specifies where the object is stored. If the object is defined in the database section of the mapping XML file, then set data_source_type to database. If it is located in the types section, then set data_source_type to outlook.
  • "online": {"view_id". The identifier of the view defined in the views.xml file that is displayed on the online SalesBook dialog box. If you use the same view for the Salesbook dialog box and the online SalesBook dialog box, then you must not specify this parameter.

If you create a direct or multi-value group (MVG) link using either of the add_mvg_link or add_direct_link functions, then pass null values instead of the view_id or left_objs_view_id or right_objs_view_id parameters.

Oracle CRM On Demand Desktop Administration Guide, Version 5.2 Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Legal Notices.