Example of Accessing Data from an Existing Business Component Instance
If Siebel CRM starts an event, then the code in this example calls an object interface method that resides on an existing business component instance. The term instance describes the current, run-time state of an object. For example, a business component instance is a run-time occurrence of a business component. It includes all of the run-time data that the business component currently contains, such as the values for all business component fields and the values for all properties of this business component. For example, an instance of the Contact business component includes the current, run-time value of the City field that resides in this business component, such as San Francisco. You can configure Siebel CRM to get a business component instance, and then modify this data or call the methods that this business component references.
In the following example, the VB script resides in the SetFieldValue event of the business component:
Sub BusComp_SetFieldValue (FieldName As String)
Dim desc As String
Dim newDesc As String
TheApplication.TraceOn "c:\temp\trace.txt", "Allocation", "All"
If FieldName = "Type" Then
newDesc = "Any valid string that contains the new description."
desc = Me.GetFieldValue("Description")
TheApplication.Trace "The previous description is " & desc
Me.SetFieldValue "Description", newDesc
TheApplication.Trace "The new description is " & newDesc
End If
TheApplication.TraceOff
End Sub