GetAssocBusComp Method for a Business Component
The GetAssocBusComp method returns a string that contains the name of the association business component. You can use the association business component to manipulate the association.
Format
BusComp.GetAssocBusComp
No arguments are available.
Usage for the GetAssocBusComp Method
It is appropriate to use the GetAssocBusComp method and the Associate method only with a many-to-many relationship that uses an intersection table. For example, account and industry. In the context of a many-to-many relationship, you can use Siebel VB to do the following:
To associate a new record, add it to the child business component. To add a record, you use the GetAssocBusComp method and the Associate method. You set the GetAssocBusComp method to Nothing in Siebel VB or null in Siebel eScript.
To insert a record, create a new record in the child business component. To insert a record, you use the GetMVGBusComp method and the NewRecord method.
If a many-to-many link exists, and if an association applet is defined for the child applet, then you can use the GetAssocBusComp method with the child business component of a parent-child view. You can use this technique instead of modifying the multivalue group business component.
Used With
COM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script
Examples
The following example is in Siebel VB. It uses the GetAssocBusComp method to add a new industry to an account:
Dim oAssocBC As BusComp
Set oAssocBC = oMainBc.GetMVGBusComp("Industry").GetAssocBusComp
With oAssocBC
.ClearToQuery
.SetSearchExpr "[SIC Code] = ""5734"""
.ExecuteQuery ForwardOnly
If .FirstRecord Then .Associate NewBefore
End With
Set oAssocBC = Nothing
The following is the same example in Siebel eScript:
//get the business Object and the business component
var oAssocBC = oMainBc.GetMVGBusComp("Industry").GetAssocBusComp();
with (oAssocBC)
{
ClearToQuery;
SetSearchExpr("[SIC Code] = '5734'");
ExecuteQuery(ForwardOnly)
if (FirstRecord())
Associate(NewBefore);
}
oAssocBC = null;
Related Topics
For more information, see the following topics: