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

Changing the XML Code in the forms_12.xml File


The new custom field must be displayed on the UI layout. The forms_nn.xml file is used to define the physical UI layout. Use Forms_12.xml for Microsoft Outlook 2007 and Microsoft Outlook 2010, which are the versions of Microsoft Outlook supported by Oracle CRM On Demand Desktop.

In this example, you add the new Membership field under the existing Lead Source field in the Contact page.

To change the XML Code in the forms_12.xml File

  1. Edit the forms_12.xml file.
  2. Place the new field in a cell.

    A label or a field must always be placed in a cell in the XML structure. Cells are aligned vertically or horizontally by enclosing them in stacks. Complete stacks are placed in cells, allowing them to be placed either vertically or horizontally again. The size of the cell is also specified on the cell. If the cell is part of a horizontal stack, then the size specification determines the width of the cell. If the cell is part of a horizontal stack, then the size specification determines the height of the cell. When you add your cell to a stack, you must increase the size of the cell that contains that stack. Otherwise, your field might be hidden in the UI.

    The cell for the field label of the Membership field is as follows:

    <cell size="22">
    <static id="lbl_stmembership" tab_order="14">
    <text>#lbl_membership</text>
    </static>
    </cell>

    The #lbl_membership data is a reference to the string displayed in the UI that is set up in the package_res.xml file.

    The cell with the field is similar to the following example:

    <cell size="22">
    <edit id="stMembership" tab_order="14">
    <field value="string">stMembership</field>
    </edit>
    </cell>

    This XML section specifies a text box that is linked to the new field. The field name must match the field created in the od_meta_info.xml file in Changing the XML Code in the od_meta_info.xml File.

    NOTE:  In the above cell examples, the values of the id and tab_order parameters must be unique. However, the tab_order parameter is optional, so you can remove it when testing the changes.

  3. Add the new Membership field under the existing Lead Source field in the Contact page, and increase the size of the horizontal stack so that the new field is visible between the existing Lead Source field and the Description text box.

    The XML changes to the forms_12.xml file include:

    • Increasing the size of the cell from 210 to 250 to accommodate the new custom field, Membership. The element for the cell that holds the horizontal stack is as follows:

    <cell size="250">

    • Inserting the field label for Membership under the existing label for Lead Source.
    • Inserting the text box for Membership under the field for Lead Source.

      These changes are shown in bold in the following example XML:

    <cell size="250">
    <stack layout="horz">
    <cell size="7">
    <stack layout="vert" spacing="1">
    <cell size="1"/>
    <cell>
    <static id="lbl_required_sign">
    <text>#lbl_required_sign</text>
    </static>
    </cell>
    </stack>
    </cell>
    <cell>
    <stack layout="horz" spacing="5">
    <!-- left side captions -->
    <cell size="140">
    <stack spacing="5" layout="vert">
    ...
    ...
    <cell size="22">
    <static id="0x20016" tab_order="15"><text>#lbl_lead_source</text>
    </static>
    </cell>
    <cell size="22">
    <static id="lbl_membership">
    <text>#lbl_membership</text>
    </static>
    </cell>
    </stack>
    </cell>
    <!-- left side fields -->
    <cell>
    <stack layout="vert" spacing="5">
    ...
    ...
    <cell size="22">
    <combobox id="LeadSource" tab_order="16">
    <field>LeadSource</field>
    <source type="ContactLeadSourcePicklist" field="Value"format=":[:(Label):]">
    </source>
    </combobox>
    </cell>
    <cell size="22">
    <edit id="stMembership" max_chars="100">
    <field value="string">stMembership</field>
    </edit>
    </cell>
    ...
    ...
    </stack>
    </cell>
    </stack>
    </cell>
    </stack>
    </cell>

  4. Verify your changes and save the forms_12.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.