Bookshelf Home | Contents | Index | PDF |
Siebel Object Interfaces Reference > Programming > Siebel Object Interface Methods > Accessing Business ComponentsThe Siebel business component object (BusComp) presents a two-dimensional grid of data values much like a table in a relational database. The named fields are analogous to columns in the database table, and the records are analogous to rows. Developers use business components to read data, manipulate it, and write it back into the Siebel database. Business components manage the complexities of multiple-table access to the database and access different types of databases. Many methods are available to use on business components for getting and setting the values of their fields. Record operations can be performed programmatically by using business component access methods. These operations invoke Siebel VB or Siebel eScript extension routines. For example, if you have created a Siebel VB or Siebel eScript script that is tied to the NewRecord event on a business component, the script is processed whenever NewRecord in that business component is processed, even if the NewRecord method was called by another Siebel VB or Siebel eScript script or was called from the Siebel object interfaces. Note that events are available only with Siebel VB or Siebel eScript. Adding and Inserting RecordsIn the context of a many-to-many relationship, you can use Siebel VB or Siebel eScript to mimic either the Add New Record command, which associates a new child record, or the Insert Record command, which creates a new record in the child business component. To associate a new child record, use GetAssocBusComp and the Associate method. To create a new record in the child, use the NewRecord method in a child business component, or use GetMVGBusComp and the NewRecord method. Committing Records to the DatabaseA commit is performed under the following circumstances:
Scenarios for Business ComponentsThe two scenarios that follow involve the use of Siebel scripts to work with business components. The first example shows how to invoke methods on an existing business component when an event is triggered. In this example, the VB script is in the SetFieldValue event of a business component: Sub BusComp_SetFieldValue (FieldName As String) The next example shows how to instantiate your own BusObject and BusComp. This example uses the PreSetFieldValue event of the Opportunity BusComp. If the Sales Stage is updated to "07 - Verbal Agreement," a decision maker must be associated with the opportunity. Otherwise, it is reset to the previous value. The Contacts for the selected opportunity are searched to see if any vice president or president is associated with the opportunity. The logical flow of instantiating your own BusComp object is as follows
The following example shows how to instantiate objects in eScript: function BusComp_PreSetFieldValue (FieldName, FieldValue) The following example shows how to instantiate objects in Siebel VB: Function BusComp_PreSetFieldValue (FieldName As String, FieldValue As String) As Integer Dim RetValue As Integer ' Because parent-child relationship is established when Methods for Accessing Business ComponentsTo access business components, use the following methods:
|
Siebel Object Interfaces Reference |