Siebel VB Language Reference > Using Siebel VB >

About Object Handling


An object is a reusable block of code. You can write code that instantiates an object or that does something. Each software application includes a set of properties and methods that modify the characteristics of an object.

A property affects how an object behaves. For example:

  • Width is a property of a range of cells in a spreadsheet.
  • Color is a property of a graph.
  • Margin is a property of a word processing document.

A method causes an application to perform an action on an object. For example:

  • Calculate for a spreadsheet
  • Snap to Grid for a graph
  • Auto-Save for a document

You can write Siebel VB that accesses a Siebel object and that modifies the properties and methods of this object. To access an object that is part of the Siebel application, you can run Siebel VB code that is external to the Siebel application.

To use a non-Siebel object in Siebel VB code, you must first assign it to an object variable. Assigning it instantiates it. To manipulate the object, you then reference the object name with or without properties and methods.

Example of Declaring an Object As a Siebel CRM Object Type

Figure 1 includes an example that configures Siebel VB to access a Siebel object. You can declare an object as a Siebel CRM object type.

Figure 1. Example of Declaring an Object as a Siebel CRM Object Type
Explanation of Callouts

To declare an object as a Siebel CRM object type, you do the following work:

  1. You create an object variable to access the code. This example uses as BusComp to declare the object. It does not use as Object. This example instantiates the business component (BusComp) Siebel object type. You could declare it as an object, but if you use the methods associated with the object type, then you must declare it as the appropriate object type.
  2. You can use methods and properties to manipulate the objects.
  3. Set oBC to nothing. It is recommended that you always set an object to nothing when your code instantiates it.

You can use similar code to access other types of objects that are compliant with COM. You can use the software application that creates the object to modify properties and methods of the objects. For an example, see Date and Time Methods.

Creating an Object Variable to Access an Object

The Declare Variable statement creates an object variable named oBC and assigns a picklist business component to this variable. The Assign COM Object statement uses a get method to assign the business component to the oBC variable. Note the following:

  • If you instantiate an application, then you can use the GetObject method or the CreateObject method.
  • If the application is already open on the Microsoft Windows desktop, then you use GetObject.
  • If the application is not open, then you can use CreateObject.

For more information, see the following topics:

Using Methods and Properties to Manipulate an Object

You can use the following format to access an object, property, or method:

appvariable.object.property
appvariable.object.method

For example, the GetPickListBusComp method of the BusComp object of the Siebel application is assigned to the oBC object variable. It returns the following value:

me.GetPickListBusComp("Sales Stage")

Siebel VB Language Reference Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.