Code That Adds a New Association

To add a new association, you add the following code to the business_logic.js file:

var opportunity_channel_partner =
  add_mvg_link("Opportunity", "ChannelPartner", "Primary Partner Id", 
null,"Opportunity.Channel_Partner.Association", "OpportunityId", 
"ChannelPartnerId",null, "ChannelPartnerStatus",null, 
["lookup:channel_partners"],false, false, false, true);
  deny_primary_delete(opportunity_channel_partner.mvg1);//optional 
opportunity_channel_partner.mvg1.dialog_template_params = {
  "dialog_caption": "#obj_activity_employee_plural","autocomplete_display_format": 
":[:(Name):]", "associations_view_caption": "#head_associated_channel", 
"associations_view_id": "channel_partner:mvg", "primary_selector_display_format": 
":[:(PartnerName):]"
  }

The ChannelPartnerStatus field contains the status of the Channel Partner object, such as unsaved, deleted, and so on.

The following describes the important attributes you can use with the add_mvg_link function.

Attribute Description

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.

left_obj_primary

The field of the Opportunity object. This field contains the primary Id for the Channel Partner object.

right_obj_primary

The field of the Channel Partner object. This field contains the primary Id for the Opportunity object.

assoc_type

The Id of the association type described in the siebel_meta_info.xml file and the siebel_basic_mapping.xml file.

left_link

The field of the association object that contains the Id of the opportunity.

right_link

The field of the association object that contains the Id of the channel partner.

left_assoc_status

The field of the association that contains the status of the opportunity.

right_assoc_status

The field of the association that contains the status of the channel partner.

left_objs_view_ids

The list of lookup view definitions you must use to display opportunity objects.

right_objs_view_ids

The list of lookup view definitions you must use to display channel partner objects.

left_primary_refresh _required

If the primary object is changed, and if the left_primary_refresh_required attribute is true, then Siebel CRM Desktop updates the object Id for the primary field of the opportunity that you specify in the left_obj_primary attribute.

If you use the following tag in the siebel_basic_mapping.xml file for this field, then set the left_primary_refresh_required attribute to true:

writer class="link_fields"

right_primary_refresh _required

If the primary object is changed, and if the right_primary_refresh_required attribute is true, then Siebel CRM Desktop updates the object Id for the primary field of the channel partner that you specify in the right_obj_primary attribute.

If you use the following tag in the siebel_basic_mapping.xml file for this field, then set the right_primary_refresh_required attribute to true:

writer class="link_fields"

assoc_left_link_refresh _required

If the opportunity object is changed, then Siebel CRM Desktop updates the OpportunityId field of the association that you specify in the left_link attribute.

If you use the following tag in the siebel_basic_mapping.xml file for this field, then set the assoc_left_link_refresh_required attribute to true:

writer class="link_fields"

assoc_right_link_refresh _required

If the channel partner object is changed, then Siebel CRM Desktop updates the ChannelPartnerId field of the association that you specify in the right_link attribute.

If you use the following tag in the siebel_basic_mapping.xml file for this field, then set the assoc_right_link_refresh_required attribute to true:

writer class="link_fields"