Siebel Object Interfaces Reference > Interfaces Reference > Application Methods >

GetBusObject Method


The GetBusObject method instantiates and returns a new instance of the business object specified in its argument.

Syntax

Application.GetBusObject(busObjectName)

Argument
Description

busObjectName

String variable or literal containing the name of the business object to instantiate.

Returns

The business object instance specified in the argument

Usage

Set the business object to Nothing to destroy the instantiated business object after it is no longer needed. If you use ActiveBusObj() you get the business object that exists already (if there is one). If you use GetBusObject() instead, any child business components are ALWAYS new ones, even if you have some already.

Used With

COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server Script

Examples

The following examples always instantiate and return a new instance of the business object specified in the argument, which is the Account business object.

The following example is in Siebel eScript:

var oBusObject = TheApplication().GetBusObject("Account");
var oBusComp = oBusObject.GetBusComp("Account");

[ Your code here ]

oBusComp = null;
oBusObject = null;

The following example is in Siebel VB:

Dim AccntBO as BusObject
Dim AccntBC as BusComp
Dim AddrBC as BusComp
Set AccntBO = TheApplication.GetBusObject("Account")
Set AccntBC = AccntBO.GetBusComp("Account")

[ your code here]

Set AccntBO = Nothing
Set AccntBC = Nothing

The following examples instantiate and return a new instance of the business object as did the previous example. However, the difference is that the business object returned could vary depending on the location from which the code is invoked, such as a Web applet event. This is useful when you want to refer to the currently active business object.

The following example is for Java Data Bean:

private SiebelDataBean m_dataBean = null;
private SiebelBusObject m_busObject = null;
m_busObject = m_dataBean.getBusObject("Opportunity");

The following example is in Siebel eScript:

var oBO = TheApplication().GetBusObject(this.BusObject.Name);

The following example is in Siebel VB:

Dim oBO as BusObject
Dim oBC as BusComp
Set oBO = TheApplication.GetBusObject(Me.BusObject.Name)

Siebel Object Interfaces Reference Copyright © 2008, Oracle. All rights reserved.