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

Adding Date Fields to a Form


This topic describes how to display a date field on an Oracle CRM On Demand Desktop form. In this example, you add Due Date and End Time date and datetime fields 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 date field to a form

  1. Update the od_meta_info.xml file by adding the following XML elements to define the fields, to the corresponding object type structure:
    • For a date only field type, add:

    <field Name="DueDate" Label="DueDate" DataType="DTYPE_DATE" />

    • For a datetime field type, add:

    <field Name="EndTime" Label="EndTime" DataType="DTYPE_UTCDATETIME" />

  2. Update the od_basic_mapping.xml file by adding the following XML code to the corresponding object type structure:

    <field id="DueDate">
    <reader>
    <mapi_user>
    <user_field id="od DueDate" ol_field_type="5"></user_field>
    <convertor>
    <datetime/>
    </convertor>
    </mapi_user>
    </reader>
    <writer>
    <outlook_user>
    <user_field id="od DueDate" ol_field_type="5"></user_field>
    <convertor>
    <datetime/>
    </convertor>
    </outlook_user>
    </writer>
    </field>

    NOTE:  For both the date and datetime field types, the mappings are equivalent, so only the XML for DueDate is shown.

  3. Update the forms_12.xml file to change the layout by adding the label for the following fields:
    • To add the date field, use the following XML sample code to the corresponding object type structure:

    <cell>
    <datetime id="due" tab_order="13" type="date" store_time="false">
    <field>DueDate</field>
    </datetime>
    </cell>

    • To add the datetime field, use the following XML sample code to the corresponding object type structure:

    <cell>
    <datetime id="end_time" tab_order="18" type="datetime">
    <field>EndTime</field>
    </datetime>
    </cell>

    In the sample XML code, 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.2 Revision A Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.