Siebel Object Interfaces Reference > Interfaces Reference > Business Component Methods >

Associate


The Associate method creates a new many-to-many relationship for the parent object through an association business component (see GetAssocBusComp).

Syntax

BusComp.Associate(whereIndicator)

Argument
Description
whereIndicator
This argument should be one of the following predefined constants or the corresponding integer: NewBefore (0) or NewAfter (1), as in NewRecord.

Returns

Not applicable

Usage

To set field values on a child record that has been associated to a parent record, use the context of the MVGBusComp.

Used With

Server Script, Mobile/Dedicated Web Client Automation Server, COM Data Control, COM Data Server, Java Data Bean, CORBA Object Manager

See Also

NewRecord
FirstSelected
GetMVGBusComp

Example

The following VB example adds the position CEO to the current record of the parent business component, and updates the Opportunity Assignment Type field. The parent business component can be any business component that includes the Sales Rep multi-value group.

Dim oParentBC as BusComp
Dim oMvgBC as BusComp
Dim oAssocBC as BusComp

Set oParentBC = me.BusComp
Set oMvgBC = OpBC.GetMVGBusComp("Sales Rep")
Set oAssocBC = oMvgBC.GetAssocBusComp

With oAssocBC
   .SetSearchSpec "Id", newPosId
   .ExecuteQuery
   .Associate NewAfter
End With

oMvgBC.SetFieldValue "Opportunity Assignment Type", NewType

Set oAssocBC = Nothing
Set oMvgBC = Nothing
Set oParentBC = Nothing

Here is the equivalent example in Siebel eScript.

var oParentBC = this.BusComp();
var oMvgBC = oParentBC.GetMVGBusComp("Sales Rep");
var oAssocBC = oMvgBC.GetAssocBusComp();

with (oAssocBC)
{
   SetSearchSpec("Id", newPosId);
   ExecuteQuery();
   Associate(NewAfter);
}

oMvgBC.SetFieldValue("Opportunity Assignment Type", NewType);

oAssocBC = null;
oMvgBC = null;
oParentBC = null;


 Siebel Object Interfaces Reference 
 Published: 18 June 2003