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

Adding Numeric Fields to a Form


This topic describes how to add a numeric field, using the edit control on an Oracle CRM On Demand Desktop form. In this example, you add two fields, Revenue and Number of Employees, to the UI form. In this procedure, you update the following metadata files:

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

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

To add a numeric field to a form

  1. Update the od_meta_info.xml file by adding the following XML elements to define the fields in the corresponding object type structure:
    • For a fraction, use DataType="DTYPE_NUMBER":

    <field Name="Revenue" Label="Revenue" DataType="DTYPE_NUMBER" />

    • For an integer, use DataType="DTYPE_INTEGER":

    <field Name="NumberEmployees" Label="NumberEmployees" DataType="DTYPE_INTEGER" IsFilterable='no'/>

  2. Update the od_basic_mapping.xml file by adding the following XML sections to the corresponding object type structure:
    • For fractions, use the convertor, <double/>:

    <field id="Revenue" ver="3">
    <reader>
    <mapi_user>
    <user_field id="od Revenue" ol_field_type="3"></user_field>
    <convertor>
    <double/>
    </convertor>
    </mapi_user>
    </reader>
    <writer>
    <outlook_user>
    <user_field id="od Revenue" ol_field_type="3"></user_field>
    <convertor>
    <double/>
    </convertor>
    </outlook_user>
    </writer>
    </field>

    • For integers, use the convertor, <integer/>:

    <field id="NumberEmployees">
    <reader>
    <mapi_user>
    <user_field id="od NumberEmployees" ol_field_type="3"></user_field>
    <convertor>
    <integer/>
    </convertor>
    </mapi_user>
    </reader>
    <writer>
    <outlook_user>
    <user_field id="od NumberEmployees" ol_field_type="3"></user_field>
    <convertor>
    <integer/>
    </convertor>
    </outlook_user>
    </writer>
    </field>

    NOTE:  If you are adding a field to the DB FACADE storage, then use the following syntax:

    <field id="NumberEmployees">
    <type>
    <simple type="integer"/>
    </type>
    </field>

  3. Update the forms_12.xml file by adding the label for the numeric field to update the UI layout:
    • For a fraction, use <field value="double">:

    <edit id="Revenue" max_chars="15" tab_order="50">
    <field value="double" precision ="2">Revenue </field>
    </edit>

    In this example, precision is the precision value; that is, the number of decimal places that is allowed after a comma.

    • For an integer, use <field value="integer">:

    <edit id="NumberEmployees" max_chars="15" tab_order="50">
    <field value="integer">NumberEmployees</field>
    </edit>

    In this example, the content of the <field> element is the field name from the od_basic_mapping.xml file.

    The steps for adding labels are provided in Changing the XML Code in the forms_12.xml File and are the same as for a text field.

  4. Update the package_res.xml file by adding the resources for the label text.

    The steps for adding the resources are provided in Changing the XML Code in the package_res.xml File and are the same as for a text field.

Oracle CRM On Demand Desktop Customization Guide, Version 5.1 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. Legal Notices.