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

Adding Text Fields to Oracle CRM On Demand Desktop


This procedure shows how to add a text field called Department to an Oracle CRM On Demand Desktop form. Use this example as a reference to add other text fields and adjust the fields to your specific requirements. Before you begin this chapter, review the chapter on customization in Oracle CRM On Demand Desktop Administration Guide.

The following procedure adds a field called Department to the Contact form in the UI.

In this procedure, you make sure the field is available through Oracle CRM On Demand Web services and then 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 text field to Oracle CRM On Demand Desktop

  1. Make sure that the field, Department, is available through Oracle CRM On Demand Web services.

    For information on using Web services, see Oracle Web Services On Demand Guide.

  2. Update the metadata files for the new Department field:
    1. Update od_meta_info.xml by adding Department to the metadata objects where making the objects available is necessary, in this example, the Contact object.
    2. Locate the <object> element by TypeId attribute set to Contact. For example:

    <object TypeId="Contact"...>

    1. Add the new <field> element (Department) to define the field:

    <field Name='Department' Label='Department' DataType='DTYPE_TEXT'/>

    where:

    • Name is the name of new field. You can define any value, which is used to access this field value.
    • Label is the label that is used to reference this field in the UI, for example, on the Oracle CRM On Demand Desktop Control Panel.
    • DataType is the type of the field. For text fields, set its value to DTYPE_TEXT. For check boxes or other Boolean fields, set its value to DTYPE_BOOL. For more information on data types, see Table 2.
  3. Update the od_basic_mapping.xml file:
    1. Locate the <type> element by the id attribute set to Contact. For example:

    <type id="Contact"...>

    1. Add the new <field> element for Department to define the mapping:

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

    If you are adding a field to an object located in the DB FACADE storage, then the syntax for the field definition differs as in the following XML code:

    <field id=" Department ">
    <type>
    <simple type="string"/>
    </type>
    </field>

    For more information on DB FACADE storage, see About Microsoft Outlook and DB FACADE Storage.

  4. Update the forms_12.xml file:

    Use this file to customize the Microsoft Outlook forms. The syntax to manipulate these files is similar to the syntax of the HTML tables. You can modify the forms_12.xml file in much the same way.

    1. Add a new label control and a text field control for the Department field below the Job Title field on the Contact form.

      To do this, insert a label, and a text field and add the XML code for the label to the section denoted by the comment "left side captions" inside the form with id = "OnDemand Contact". Insert the following XML code just after the cell containing the #lbl_job_title label control to add the new Department label. The text #lbl_department is used to specify a key that is used in the package_res.xml file to determine the localized value for the label, which is covered in the next step:

    <cell size="22">
    <static id="lbl_department">
    <text>#lbl_department</text>
    </static>
    </cell>

    1. After adding the label, add the text field control, using the following XML code:

    <cell size="22">
    <edit id="department">
    <field value="string">Department</field>
    </edit>
    </cell>

    You must add this XML under the section labeled by the comment: left side fields. In this case, you want to add the field just above the cell stack containing the ContactToAccount and btn_mvgAccount controls and just below the cell stack containing the status_image.

    1. You must increase the size of the cell that houses all of these child objects to make more room for this new field on the UI by changing the size value from 210 to 235, for this example:

    <cell size="235">

  5. Update the package_res.xml file by adding the following element to the package_res.xml file to have the Contact form render the Department label through the associated key value:

    <str key="lbl_department">Department</str>

    The package_res.xml file is used to provide localized values and images to Oracle CRM On Demand Desktop. Because you have added the new Department field to the Contact form, you must provide the text for the label. In the modification of the forms_12.xml file in Step 4, you created a label control with the text value #lbl_department. The text value identifies the key to use in the package_res.xml file.

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