Oracle CRM On Demand Desktop Customization Guide > Adding Custom Fields to Oracle CRM On Demand Desktop >

Adding a Picklist Field in Oracle CRM On Demand Desktop


This topic shows how to add a picklist field to the Contact object type.

Before You Begin

Review the chapter on customization in Oracle CRM On Demand Desktop Administration Guide.

In this procedure, you update the following metadata files:

  • od_meta_info.xml
  • od_basic_mapping.xml
  • forms_12.xml

For information on the contents of these files, see About the Metadata Files Updated During Customization.

To add a picklist to the Contact object type

  1. Define the objects and fields to synchronize with Oracle CRM On Demand as follows:
    1. Use an XML editor to open the od_meta_info.xml file.
    2. In the od_meta_info.xml file, locate the following element:

    <object TypeId='Contact' ...>

    The <object> element contains several child <field> elements. These child elements define the fields in the Contact object.

    1. Add the following <field> element as a child of the <object TypeId='Contact' ...> element:

    <field Name="ContactType" Label="Contact Type" DataType="DTYPE_TEXT" HasPicklist="yes" CRMName="Contact Type" />

    In this example, ContactType is the exact field name that is used in SOAP queries.

    1. Save and close the od_meta_info.xml file.
  2. Map the picklist field from the Contact object in the Oracle CRM On Demand database to a field in Oracle CRM On Demand Desktop as follows:
    1. Use an XML editor to open the od_basic_mapping.xml file.
    2. In the od_basic_mapping.xml file, locate the following element:

    <type id="Contact" ...>

    The <object> element contains several child <field> elements. These child elements define the fields in the Contact object.

    1. Add the following <field> element as a child element of the <object TypeId='Contact' ...> element:

    <field id="ContactType">
      <reader>
        <mapi_user>
          <user_field id="od ContactType" ol_field_type="1"></user_field>
            <convertor>
              <string/>
            </convertor>
        </mapi_user>
      </reader>
      <writer>
        <outlook_user>
          <user_field id="od ContactType" ol_field_type="1"></user_field>
            <convertor>
              <string/>
            </convertor>
        </outlook_user>
      </writer>
    </field>

    1. Create a new object type for the picklist.

      To create a new object type for the picklist, you must use the following format for the value of the id attribute of the <type> element:

    <type id="object_namefield_namePicklist">

    where:

    • object_name is the name of the object type in the od_meta_info.xml file.
    • field_name is the name of the field in the object that you define in object_name.

      In this example for the Contact Type field, add the following XML code inside the <database><types>...</types></database> elements:

    <type id = "ContactContactTypePicklist" icon = "type_image:Generic:16">  <field id = "Label">
        <type>
          <simple type = "string"/>
        </type>
      </field>
      <field id = "Value">
        <type>
          <simple type = "string"/>
        </type>
      </field>
      <field id = "SortOrder">
        <type>
          <simple type = "integer"/>
        </type>
      </field>
      <field id = "IsDefault">
        <type>
          <simple type = "boolean"/>
        </type>
      </field>
      <field id = "ParentCode">
        <type>
          <simple type = "string"/>
        </type>
      </field>
    </type>

  3. Customize the picklist control on the form layout by adding the following code in forms_12.xml in the vertical stack, as an example:

    <cell size="22">
      <combobox id="ContactType" tab_order="16">
        <items format=":[:(Label):]" value_column="Value" has_null_item="false">
          <source type="auto" name="ContactContactTypePicklist"/>
            <order_by>
              <order ascend="true">SortOrder</order>
            </order_by>
        </items>
        <field>ContactType</field>
      </combobox>
    </cell>

    where:

    • The attribute name of <source> is equal to the object type for the for the picklist form in Step d.
    • <field> contains the name of the picklist field.
    • The has_null_item attribute of <items> is set to false to prevent picking an empty value from the picklist.

      For more information on a vertical stack, see About Vertical and Horizontal Stacks.

Oracle CRM On Demand Desktop Customization Guide, Version 5.2 Revision A Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.