Bookshelf Home | Contents | Index | Search | PDF |
Siebel Object Interfaces Reference > Interfaces Reference > Business Component Methods >
GetAssocBusComp
GetAssocBusComp returns the association business component. The association business component can be used to operate on the association using the normal business component mechanisms.
Syntax
BusComp.GetAssocBusComp
Returns
The association business component for the current business component
Usage
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 N:M Link is used and the Child Applet has an Association Applet defined.
Used With
Server Script, Mobile/Dedicated Web Client Automation Server, COM Data Control, COM Data Server, Java Data Bean, CORBA Object Manager
Example
The following Siebel VB sample code using GetAssocBusComp adds a new industry to an account record:
Dim oAssocBC As BusComp
Set oAssocBC = oMainBc.GetMVGBusComp("Industry").GetAssocBusComp
With oAssocBC
.ActivateField "SIC Code"
.SetSearchExpr "[SIC Code] = ""5734"" "
.ExecuteQuery ForwardOnlyIf .FirstRecord Then .Associate NewBefore
End With
Set oAssocBC = Nothing
Here is the equivalent Siebel eScript code.
var oAssocBC = oMainBc.GetMVGBusComp("Industry").GetAssocBusComp();
with (oAssocBC)
{
ActivateField("SIC Code");
SetSearchExpr("[SIC Code] = ""5734"" ");
ExecuteQuery(ForwardOnly)If (FirstRecord)
Associate(NewBefore);
}oAssocBC = null;
See Also
Bookshelf Home | Contents | Index | Search | PDF |
Siebel Object Interfaces Reference Published: 18 June 2003 |