Siebel CRM Desktop for Microsoft Outlook Administration Guide > Customizing Siebel CRM Desktop >

Removing Child Objects


This topic describes an example of how to remove a child object. It describes how to remove the child notes section from the parent contact form. You comment out the object that Siebel CRM Desktop must remove in the various XML files instead of removing the object from the customization package.

To remove child objects

  1. Remove the objects from the client:

    For more information about the objects that this step removes, see Example of Removing Child Objects:

    1. Use an XML editor to open the forms_xx.xml file.
    2. Locate, and then comment the following code:

    <!-- notes view -->
    .
    .
    .
    <!-- end notes view -->

    To comment this code, you remove the intervening comment characters. For example:

    <!-- notes view
    .
    .
    .
    end notes view -->

    For more information, see Commenting in XML.

    1. Use a JavaScript editor to open the forms.js file.
    2. Locate, and then comment the following code:

    register_view_control_with_button(ctx, "Contact.Contact_Note","notes_view",
    "btn_add_note", "btn_remove_note", null, {"created_from_ctx_type": "link_me",
    "custom_view_ctrl": true });

    To comment this code, you add the following characters at the beginning and end of the code segment:

    /*
      .
      .
      .
    /

    For example:

    /*
    register_view_control_with_button(ctx, "Contact.Contact_Note","notes_view",
    "btn_add_note", "btn_remove_note", null, {"created_from_ctx_type": "link_me",
    "custom_view_ctrl": true });
    /

    For more information, see Registering View Controls and Commenting in JavaScript.

  2. Make sure CRM Desktop does not synchronize data for the objects that uses in the notes section of the view:
    1. Use an XML editor to open the siebel_basic_mapping.xml file.
    2. Locate, and then comment the following code:

    type id="Contact.Contact_Note"
    icon="type_image:Contact.Contact_Note:16">
      <field id ="Contact Id">
        <type>
          <simple type="binary"/>
        </type>
      </field>
    <field id ="Note Type">
      <type>
        <simple type="string"/>
      </type>
    </field>
      <field id ="Note">
        <type>
          <simple type="string"/>
        </type>
      </field>
      <field id ="Created">
        <type>
          <simple type="datetime"/>
        </type>
      </field>
      <field id ="Created By">
        <type>
          <foreign_key>
            <type_id>Employee</type_id>
          </foreign_key>
        </type>
      </field>
      <field id ="Created By Name">
        <type>
          <simple type="string"/>
        </type>
      </field>
      <field id ="NoteStatus">
        <type>
          <simple type="string"/>
        </type>
      </field>
    </type

    To comment this code, you add the following characters at the beginning and end of the code segment:

    <!--
      .
      .
      .
    -->

    For example:

    <!-- type id="Contact.Contact_Note"
    .
    .
    .
    </type -->

    For more information, see Commenting in XML.

    1. Locate, and then comment the following code:

    type id="Contact.Contact_NoteNote TypePicklist"
    icon="type_image:Contact.Contact_NoteNote TypePicklist:16">
      <field id ="Label">
        <type>
          <simple type="string"/>
        </type>
      </field>
      <field id ="Value">
        <type>
          <simple type="string"/>
        </type>
      </field>
      <field id ="SortOrder">
        <type>
          <simple type="integer"/>
        </type>
      </field>
      <field id ="IsDefault">
        <type>
          <simple type="boolean"/>
        </type>
      </field>
    </type

    This step prevents CRM Desktop from processing data for the picklist object that it uses for the note object type.

    1. Use an XML editor to open the siebel_meta_info.xml file.
    2. Locate, and then comment the following code:

    object TypeId='Contact.Contact_Note'
    Label='#obj_conatct_note' LabelPlural='#obj_conatct_note_plural'
    EnableGetIDsBatching='true'IntObjName='CRMDesktopContactIO'SiebMsgXmlElemNam
    e='ContactNote'SiebMsgXmlCollectionElemName='ListOfContactNote' >
    <viewmodes General="All" Dedup="All" />
    <open_with_url_tmpl>
    <![CDATA[:[:(protocol):]://:[:(hostname):]::[:(port):]/sales/_:[:(lan
    g):]?SWECmd=GotoView&SWEView=Contact+Note+View&SWERF=1&
    SWEHo=:[:(hostname):]&SWEBU=1&SWEApplet0=Contact+Form+Applet&SWERowId0=:[:(p
    arent_id):]&SWEApplet1=Contact+Note+Applet&SWERowId1=:[:(own_id):]]]>
      </open_with_url_tmpl>
      <extra_command_options>
        <option Name='PrimaryKey1M' Value='Id' />
        <option Name='ForeignKey1M' Value='Contact Id'/>
        <option Name='Cardinality' Value='1M' />
        <option Name='ServerServiceVersion' Value='2'/>
      </extra_command_options>
    <field Name='Conflict Id' Label='Conflict Id' DataType='DTYPE_ID'
    IsFilterable='no' IsHidden='yes'IOElemName='ConflictId' />
    <field Name='Contact Id' Label='Contact Id' DataType='DTYPE_ID'
    IsNullable='no' IsFilterable='no'IsRefObjId='yes' RefObjTypeId='Contact'
    RefObjIsParent='yes'IsPartOfUserKey='yes' IOElemName='ContactId' />
    <field Name='Created'Label='#fld_contact_contact_note@created'
    DataType='DTYPE_DATETIME' IsPartOfUserKey='yes'IOElemName='Created' />
    <field Name='Created By' Label='Created By' DataType='DTYPE_ID'
    IsFilterable='no' IsRefObjId='yes' RefObjTypeId='Employee'
    IOElemName='CreatedBy' />
    <field Name='Created By Name'
    Label='#fld_contact_contact_note@created_by_name' DataType='DTYPE_TEXT'
    IOElemName='CreatedByName' />
    <field Name='Created Date' Label='Created Date' DataType='DTYPE_UTCDATETIME'
    IsHidden='yes' IOElemName='CreatedDate' />
    <field Name='DS Updated' Label='DS Updated' DataType='DTYPE_DATETIME'
    IsFilterable='no' IsHidden='yes' IsTimestamp='yes' IOElemName='DBLastUpd' />
    <field Name='Id' Label='Id' IsPrimaryKey='yes' DataType='DTYPE_ID'
    IsFilterable='no' IsHidden='yes' IsPartOfUserKey='yes' IOElemName='Id' />
    <field Name='Mod Id' Label='Mod Id' DataType='DTYPE_ID' IsFilterable='no'
    IsHidden='yes' IOElemName='ModId' />
    <field Name='Note' Label='#fld_contact_contact_note@note'
    DataType='DTYPE_NOTE' IOElemName='Note' />
    <field Name='Note Type' Label='#fld_contact_contact_note@note_type'
    DataType='DTYPE_TEXT' HasPicklist='yes' PicklistIsStatic='yes'
    PicklistCollectionType='FINS_NOTE_ALERT_MLOV'
    PicklistTypeId='List_Of_Values' IOElemName='NoteType' />
    <field Name='Private' Label='Private' DataType='DTYPE_BOOL' IsHidden='yes'
    IOElemName='Private' />
    <field Name='Updated' Label='Updated' DataType='DTYPE_DATETIME'
    IsHidden='yes' IOElemName='Updated' />
    <field Name='Updated By' Label='Updated By' DataType='DTYPE_ID'
    IsFilterable='no' IsHidden='yes' IOElemName='UpdatedBy' />
    </object>

    This step prevents CRM Desktop from processing data for the note object.

  3. Modify the connector configuration:
    1. Use an XML editor to open the connector_configuration.xml file.
    2. Locate, and then comment the following code:

    type id="Contact.Contact_Note">
    <view
    label="#obj_conatct_note"label_plural="#obj_conatct_note_plural"small_icon="
    type_image:Note:16"normal_icon="type_image:Note:24"large_icon="type_image:Note:48" suppress_on_top="true">
    </view>
    <synchronizer name_format=":[:(Note):]"threshold="10">
      <links>
        <link required="true"owned="true">Contact Id</link>
      <link>Created By</link>
      </links>
        </synchronizer>
      </type

    This step removes the definition of the note object.

    1. Locate, and then comment the following code:

    type id="Contact.Contact_Note">
      <group link="or">
        <collection container_type="Contact" foreign_key="Contact Id">
          <primary_restriction>
            <group link="and">
            </group>
          </primary_restriction>
          <container_restriction>
            <group link="and">
            </group>
          </container_restriction>
        </collection>
      </group>
    </type

    This step removes the definition of the note object from the filter presets.

  4. Modify the business logic:
    1. Use an XML editor to open the business_logic.js file.
    2. Locate, and then comment the following code:

    add_direct_link("Contact.Contact_Note", "Contact", "ContactId", true, null,
    false, "NoteStatus", null, true);

    To comment this code, you can add two forward slashes at the beginning of the code. For example:

    //add_direct_link("Contact.Contact_Note", "Contact", "ContactId", true, null,
    false, "NoteStatus", null, true);

    This step removes the definition that CRM Desktop uses for the link between the Contact object and the Contact_Note object.

    1. Locate, and then comment the following code:

    add_simple_trigger(form_helpers.create_dialog_show("Note Dlg",{
    "form_handler": forms.notes_dialog, "dialog_template_params":
    {"picklist_type": "Contact.Contact_NoteNote TypePicklist" } }),null,
    "Contact.Contact_Note", null, "show");

    This step removes the trigger that CRM Desktop uses to open the Note dialog box.

    1. Locate, and then comment the following code:

    scheme.objects.get_object("Contact.Contact_Note").get_field("Note
    Type")["initial_value_res"]
    ="lang_contact_note_initial_type"scheme.objects.get_object("Contact.Contact_
    Note").get_field("Created")["initial_value_fn"] =
    get_current_date;scheme.objects.get_object("Contact.Contact_Note").get_field
    ("Created By Name")["initial_value_fn"] =
    get_current_user_login;scheme.objects.get_object("Contact.Contact_Note")["in
    itial_links_fn"] = prefill_owner;

    To comment this code, you can add forward slashes and asterisks. For more information, see Commenting in JavaScript. This step removes the definitions that CRM Desktop uses for predefault values.

Example of Removing Child Objects

Figure 12 illustrates a portion of the contact form that Siebel CRM Desktop displays before you remove the notes section.

Figure 12. Notes Section of the Contact Form

Figure 13 illustrates a portion of the contact form that Siebel CRM Desktop displays after you remove the notes section.

Figure 13. Contact Form That Siebel CRM Desktop Displays After You Remove the Notes Section

Commenting in XML

You can use the following syntax to add a comment In XML or HTML:

<!—This is a comment -->

An XML comment begins with the following code:

<!--

An XML comment ends with the following code:

-->

For example, consider the following code:

<object><field></field><field></field></object>

To comment this code, you use the following syntax:

<!-- object><field></field><field></field></object -->

Commenting in JavaScript

You can comment code in Javascript in two different ways. A typical XML comment begins with the following code:

/*

A typical XML comment ends with the following code:

*/

For example:

/* This is a comment */

You can also add a set of forward slashes (//) to comment an entire line of code. All code that occurs after these slashes on the line that contains the slashes is part of the comment. For example:

// This is a comment

Assume you must comment all of the following code:

var a = 0;
var b;
a = a + 1;
b = a;

The following syntax uses the slash and asterisk to comment all of the code:

/*
var a = 0;
var b;
a = a + 1;
b = a;
*/

The following syntax uses a set of forward slashes to comment all of the code:

// var a = 0;
// var b;
// a = a + 1;
// b = a;

In general, it is recommended that you use the slash and asterisk to comment multiple lines of code.

Siebel CRM Desktop for Microsoft Outlook Administration Guide Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.