Siebel Object Interfaces Reference > Interfaces Reference > Application Methods >

ActiveBusObject Method


ActiveBusObject returns the business object of the active view.

Syntax

Application.ActiveBusObject

Argument
Description

Not applicable

 

Returns

The business object of the active view

Usage

Do not use ActiveBusObject in any event handler that may be initiated by the COM Data Server, COM Data Control, or Java Data Bean. 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

Browser Script, Mobile Web Client Automation Server, Server Script

Example

The following example is in Browser Script:

function Applet_Load ()
{
   var oBusObj;
   oBusObj = theApplication().ActiveBusObject();
   theApplication().SWEAlert("The active business object is " + oBusObj.Name() + ".")
}

The following samples show an example of server side script that could be invoked from a custom button on a child applet within a view. The script first checks to see if the Contact business object is active, and if so, retrieves the email address of the currently active parent Contact record. The custom 'SendEmail()' function is then invoked using the Contact's email address. Note that the objects are not destroyed at the end of the script, as they are the ones that are currently active in the user interface.

The following example is in Siebel eScript:

function WebApplet_PreInvokeMethod (MethodName)
{
   if (MethodName == "Send Email")
   {
      var oBO = TheApplication().ActiveBusObject();

      if (oBO.Name() == "Contact")
      {
        var oBC = oBO.GetBusComp("Contact");
         var sEmail = oBC.GetFieldValue("Email Address");

         SendMail(sEmail);

         sEmail ="";
       }
      return (CancelOperation);
   }
   return (ContinueOperation);
}

The following example is in Siebel VB:

Function WebApplet_PreInvokeMethod (MethodName As String) As Integer

   Dim iRtn As Integer
   iRtn = ContinueOperation

   If MethodName = "Send Email" Then

     Dim oBO As BusObject
      Set oBO = TheApplication.ActiveBusObject()

      If oBO.Name() = "Contact" Then

         Dim oBC As BusComp
         Dim sEmail As String

         Set oBC = oBO.GetBusComp("Contact")

         sEmail = oBC.GetFieldValue("Email Address")

         SendEmail(sEmail)

         sEmail =""

      End If

      iRtn = CancelOperation

   End If

   WebApplet_PreInvokeMethod = iRtn
End Function

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