Siebel Object Interfaces Reference > Interfaces Reference > Business Component Methods >
GetAssocBusComp returns the association business component. The association business component can be used to operate on the association using the normal business component mechanisms.
The association business component for a business component
This method and the Associate method make sense only for many-to-many relationships, which are based on intersection tables, for example Account and Industry. In the context of a many-to-many relationship, you can use Siebel VB to either add a new record (that is, associate a new child record), or insert a record (that is, create a new record) in the child business component. To add a record, use GetAssocBusComp and the Associate method. To insert a record, use GetMVGBusComp and the NewRecord method. The GetAssocBusComp should be set to Nothing after use.
GetAssocBusComp can also be applied to the Child Business Component of a Master Detail View (rather than upon the MVG BusComp) when a M:M Link is used and the Child Applet has an Association Applet defined.
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server Script
The following example is in Siebel VB and uses GetAssocBusComp to add a new industry to an account record:
Dim oAssocBC As BusComp
Set oAssocBC = oMainBc.GetMVGBusComp("Industry").GetAssocBusComp
.SetSearchExpr "[SIC Code] = ""5734"""
If .FirstRecord Then .Associate NewBefore
Set oAssocBC = Nothing
The following is the equivalent Siebel eScript code:
//get the business Object and the business component
var oAssocBC = oMainBc.GetMVGBusComp("Industry").GetAssocBusComp();
SetSearchExpr("[SIC Code] = '5734'");
oAssocBC = null;