Siebel VB Language Reference > Siebel VB Language Reference >

Object Class


Object is a class that provides access to COM automation objects.

Syntax

Dim variableName As Object

Placeholder
Description
variableName
The name of the object variable to declare

Returns

Not applicable

Usage

To create a new object, first dimension a variable, using the Dim statement, then set the variable to the return value of CreateObject or GetObject, as follows:

Dim COM As Object

Set COM = CreateObject("spoly.cpoly")

To refer to a method or property of the newly created object, use the syntax objectvar.property or objectvar.method, as follows:

COM.reset

Example

This example uses the special Siebel object class BusComp to declare the variables used for accessing the Account Contacts view within the Siebel application.

Sub Button1_Click
   Dim i as integer
   Dim icount as integer
   Dim oBC as BusComp

   ' BusObject returns the business object associated with a
   ' control or applet.
   ' GetBusComp returns a reference to a Siebel
   ' business component that is in the UI context

   set oBC = me.BusObject.GetBusComp("Contact")

   i = oBC.FirstRecord ' returns 0 if fails, 1 if succeeds
   if i <> 1 then
      TheRaiseErrorText "Error accessing contact records for the account."
   else
      icount = 0
      ' NextRecord returns 1 if it successfully
      ' moved to the next record in the BC
      While i = 1
         icount = icount + 1
         i = oBC.NextRecord ' returns 1 if successful
      wend
      oBC.FirstRecord
      end if
End Sub

See Also

CreateObject Function
GetObject Function
New Operator
Nothing Function
Typeof Function


 Siebel VB Language Reference
 Published: 18 June 2003