Siebel CRM Desktop for IBM Notes Administration Guide > Customizing Multi-Value Groups > Process of Creating MVG Fields >
Example Code You Use to Add an MVG
This topic describes some of the code you use to add an MVG in this example. It includes the following topics:
Code That Adds a Custom Object Type
To add a custom object type, you add the following code anywhere in the siebel_meta_info.xml file assist with debugging, it is recommended that you place this code after the last Type definition: <object TypeId='ChannelPartner' Label='Channel Partner' LabelPlural='Channel Partners' EnableGetIDsBatching='true' ViewMode='Sales Rep' IntObjName='Channel Partner' SiebMsgXmlElemName='ChannelPartner' SiebMsgXmlCollectionElemName='ListOfChannelPartner' >
<field Name='DS Updated' Label='DS Updated' DataType='DTYPE_DATETIME' IsFilterable='no' IsHidden='yes' IOElemName='DSUpdated' />
<field Name='Id' Label='Id' IsPrimaryKey='yes' DataType='DTYPE_ID' IsFilterable='no' IsHidden='yes' IOElemName='Id'/>
<field Name='Name' Label='Name' DataType='DTYPE_TEXT' IsPartOfUserKey='yes' IOElemName='Name' />
<field Name='Location' Label='Location' DataType='DTYPE_TEXT' IsPartOfUserKey='yes' IOElemName='Location'/>
</object>
This code does the following:
- Uses properties of the integration object and integration component as the values for attributes.
- References only a few of the many fields that exist in the Channel Partner object in Siebel CRM.
- Uses the Name and Location fields as parts of the user key. You define the natural key in the Ln_connector_configuration.xml file.
Code That Maps a Custom Object
You can map a field of a Siebel CRM object to the IBM Notes field or to a custom Siebel CRM Desktop field. For example, you can do the following:
- Map the Name field in Siebel CRM to the LastName field in IBM Notes
- Map the mapLocation field in IBM Notes to the Location field in Siebel CRM
To map objects, you add the following code to the Ln_siebel_basic_mapping.xml file: <type id="ChannelPartner"> <field id="Name"> <reader> <lotus_std> <lotus_field id="Name" /> <convertor> <string /> </convertor> </lotus_std> </reader> <writer> <lotus_std> <lotus_field id="LastName" /> <convertor> <string /> </convertor> </lotus_std> </writer> </field> <field id="Location"> <reader> <lotus_std> <lotus_field id="Location" /> <convertor> <string /> </convertor> </lotus_std> </reader> <writer> <lotus_std> <lotus_field id="Location" /> <convertor> <string /> </convertor> </lotus_std> </writer> </field> </type>
Note the following requirements:
- The value for the type id tag in the Ln_siebel_basic_mapping.xml file must equal the value in the TypeId object in the siebel_meta_info.xml file.
- If you define a new type, then you must include the form tag. The value for the form tag must equal the form alias. This example does not require a form, so the form tag is empty.
Code That Configures Synchronization for a Custom Object
To configure synchronization for a custom object, you add the following code to the Ln_connector_configuration.xml file: <type id="ChannelPartner"> <view label="Channel Partner" label_plural="Channel Partners" small_icon="type_image:Account:16" normal_icon="type_image:Account:24" large_icon="type_image:Account:48"> </view> <synchronizer name_format=":[:(Name):]"> <links> </links> <natural_keys> <natural_key> <field>Name</field> <field>Location</field> </natural_key> </natural_keys> </synchronizer> </type>
Note the following:
- The value in the type id tag must equal the value in the TypeId object in the meta_info.xml file.
- The natural_key tag includes the Name and Location fields as part of the user key.
Code That Adds a New Association
To add a new association, you add the following code to the CreateMetaScheme function in the SBL.BusinessLogic script library: Call Helper.AddMVGLink("Opportunity", "ChannelPartner", _ Opportunity.Channel_Partner.Association", _ CRMDLeftId", "CRMDRightId", _ CRMDLeftStatus", "CRMDRightStatus", _ LINK_TAG_MVG, _ "PrimaryPartnerId", "")
Table 19 describes the important attributes you can use with the AddMVGLink function.
Table 19. Attributes in the Code That Add a New Association
|
|
left_type |
The type of the first linked object. For example, Opportunity. |
right_type |
The type of the second linked object. For example, Channel Partner. |
associationType |
The Id of the association type described in the siebel_meta_info.xml file and the Ln_siebel_basic_mapping.xml file. |
leftIdField |
The field of the association object that contains the ID of the left object. |
rightIdField |
The field of the association object that contains the ID of the right object. |
leftStatusField |
The field of the association that contains the status of the left object. |
rightStatusField |
The field of the association that contains the status of the right object. |
tag |
The tag name of the link. |
leftObjPrimaryField |
The field of the left object which contains the primary ID for the right object. The field can contain an empty value. |
rightObjPrimaryField |
The field of the right object which contains the primary ID for the left object. he field can contain an empty value. |
|