Oracle CRM On Demand Desktop Administration Guide > Customizing Oracle CRM On Demand Desktop > Roadmap for Adding an MVG Field >

Process of Modifying the Customization Package to Add an MVG


This task is a step in Roadmap for Adding an MVG Field.

To modify the customization package to add an MVG, do the following:

  1. Adding a Custom Object
  2. Adding the MVG Link
  3. Adding the Primary Field
  4. Adding a Field
  5. Adding a Lookup View
  6. Code to Define a SalesBook Control
  7. Adding a Label, Button, and Selector Control
  8. Customizing the Validation Message and Labels

Adding a Custom Object

This task is a step in Process of Modifying the Customization Package to Add an MVG.

To add a custom object to Oracle CRM On Demand Desktop, you display the object in Oracle CRM On Demand and then modify customization package XML files. In this example, you make available and then add the Channel Partner object.

To add a custom object

  1. Make sure the object you must add is available.
  2. To add a custom object type, modify the od_meta_info.xml file.

    For more information, see Code to Add a Custom Object Type.

  3. To map objects, modify the od_basic_mapping.xml file.

    For more information, see Code to Map a Custom Object.

  4. To configure synchronization for the custom object, modify the connector_configuration.xml file.

For more information, see Code to Configure the Synchronization of a Custom Object.

Adding the MVG Link

This task is a step in Process of Modifying the Customization Package to Add an MVG.

In this topic, you add the MVG link to the business logic file.

To add the MVG link

  1. Use a JavaScript editor to open the business_logic.js file.

    For more information, see Files in the Customization Package.

  2. Locate the following function:

    create_ondemand_meta_scheme2

  3. Add the code to add a new association.

    For more information, see Code to Add a New Association.

Adding the Primary Field

This task is a step in Process of Modifying the Customization Package to Add an MVG.

In this topic, you add the primary field to the customization package. This field displays in the MVG dialog box that you add for this example.

To add the primary field

  1. To add the primary field, do the following:
    1. Use an XML editor to open the od_meta_info.xml file.
    2. Add the following code to the Opportunity object in the od_meta_info.xml file:

    <field Name='Primary Partner Id' Label='Primary Partner Id' DataType='DTYPE_ID' IsFilterable='no' IsRefObjId='yes' RefObjTypeId='ChannelPartner' IOElemName='PrimaryPartnerId' />

    This code adds the field, Primary Partner Id, to the Opportunity type. The field is defined as the reference for ChannelPartner type.

    1. Save and then close the od_meta_info.xml file.
    2. Use an XML editor to open the od_basic_mapping.xml file:
    3. Add the following code to the Opportunity type element:

    <field id="Primary Partner Id">
        <reader>
          <mapi_user>
          <user_field id="od Primary Partner Id" ol_field_type="1"></user_field>
            <convertor><binary_hexstring/></convertor>
          </mapi_user>
        </reader>
        <writer>
          <outlook_user>
          <user_field id="od Primary Partner Id" ol_field_type="1"></user_field>
            <convertor><binary_hexstring/></convertor>
          </outlook_user>
        </writer>
    </field>

    This code adds custom field Primary Partner Id to Opportunity type to access the field from Microsoft Outlook. The field is defined as binary_hexstring.

  2. Add the link:
    1. Use an XML editor to open the connector_configuration.xml file.
    2. Add the following code to the Opportunity type element:

    <link>Primary Partner Id</link>

    This code is required for defining foreign key fields; that is, for defining links to other objects.

    1. Save and then close the connector_configuration.xml file.

Adding a Field

This task is a step in Process of Modifying the Customization Package to Add an MVG.

This topic describes how to add the ChannelPartnerStatus field.

To add a field

  1. Use an XML editor to open the od_basic_mapping.xml file.
  2. Add the following code to the Opportunity.Channel_Partner.Association type in the od_basic_mapping.xml file.

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

  3. Save and then close the od_basic_mapping.xml file.

Adding a Lookup View

This task is a step in Process of Modifying the Customization Package to Add an MVG.

To customize a SalesBook control, you use the definition of a lookup view. A SalesBook control displays a list of objects and then allows the user to choose any object from this list. Oracle CRM On Demand Desktop uses this control on forms and MVG dialog boxes. In this example, you add the definition for a lookup view for Channel Partner objects.

To add a lookup view

  1. Use an XML editor to open the lookup_view_defs.xml file.
  2. Add the following code to the array element that contains the lookup types in the lookup_view_defs.xml file:

    <item value="ChannelPartner"></item>

  3. Add the definition for the lookup view.

    For more information, see Code to Add a Lookup View.

Adding a Label, Button, and Selector Control

This task is a step in Process of Modifying the Customization Package to Add an MVG.

In this topic, you add a label, button, and selector control.

To add a label, button, and selector control

  1. Use an XML editor to open the forms_xx.xml file.
  2. Add a label for the MVG:
  3. Locate the following section:

    right side captions

  4. Insert the following code immediately under the code that defines the Probability label:

    <cell size="22">
        <static id="0x20014" tab_order="166">
          <text>#lbl_channel_partner</text>
        </static>
    </cell>

  5. Add the button and primary selector control:
    1. Locate the following section:

    right side fields

    1. Add the following code immediately under the code that defines the Probability control.

    <cell size="22">
        <stack layout="horz">
          <cell>
            <mvg_primary_selector id="channel_partner_mvg">
              <source type="Opportunity.Channel_Partner.Association"           left_id="OpportunityId" item_value="ChannelPartnerId"           display_format=":[:(PartnerName):]"></source>
              <field>Primary Partner Id</field>
            </mvg_primary_selector>
          </cell>
          <cell size="5"></cell>
          <cell size="22">
            <button id="btn_mvgChannelPartner">
              <text>...</text>
            </button>
          </cell>
        </stack>
    </cell>

    Make sure you specify the Id for the button and the Id for the primary selector in the same way that you specified them in the script.

  6. Increase the size of the cell that contains the label, button, and selector control:
    1. Locate the following section:

    Category bar

    1. Locate the fifth cell that is included in the Category bar section.
    2. Change the code of the fifth cell to the following code:

    <cell size="153">

  7. Save and then close the forms_xx.xml file.

Customizing the Validation Message and Labels

This task is a step in Process of Modifying the Customization Package to Add an MVG.

In this topic, you customize the validation message and a label for the dialog box and forms.

To customize the validation message and labels

  1. Use an XML editor to open the package_res.xml file.
  2. Add the following code to the Script section:

    <str key="msg_channel_partner_present">This channel partner is already present in the list.</str> <str key="msg_channel_partner_is_primary">This channel partner is primary. The primary record cannot be removed. To remove this record, make another record primary first.</str> <str key="msg_channel_partner_add_caption">Add channel partner.</str><str key="lbl_channel_partner">Lead Partner Name</str>

  3. Add the same code that you added in Step 2 to the Messages section.
  4. Close and then save the package_res.xml file.
  5. The following code specifies the values for labels that you use in the dialog box and form layouts:

    <str key="lbl_channel_partner">Lead Partner Name</str>

Oracle CRM On Demand Desktop Administration Guide, Version 5.2 Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Legal Notices.