Siebel Object Interfaces Reference > Interfaces Reference > Application Methods >

GotoView Method


GotoView activates the named view and its BusObject. As a side effect, this method activates the view's primary applet and its BusComp and activates the primary applet's first tab sequence control. Further, this method deactivates any BusObject, BusComp, applet, or control objects that were active prior to this method call.

Syntax

Application.GotoView(ViewName[, BusinessObjectName])

Argument
Description

ViewName

The name of the view for the Siebel application to display

BusinessObjectName

An optional argument to specify the business object to use for displaying the view. You cannot specify the current active business object as an argument to GotoView. If this argument is not supplied, or is specified as Nothing, a new business object is loaded in the normal fashion.

Returns

Not applicable

Usage

If a business object has not been instantiated, BusinessObjectName should have the value Nothing.

NOTE:  The GotoView method is not supported in the following events: Application_Navigate, Application_PreNavigate, Navigate, PreNavigate, and WebApplet_Load.

The following Siebel VB script uses GotoView to programmatically navigate to the Opportunity List view.

TheApplication.GotoView "Opportunity List View", Nothing

Alternatively, if your application has already instantiated an Opportunity object with the object reference of objOppty, the appropriate usage in Siebel VB is:

TheApplication.GotoView "Opportunity List View", objOppty

NOTE:  When this method is used in a Siebel VB or eScript script, regardless of where it appears in the script, it is executed last.

The Control property "Show Popup" should not be set to TRUE on a button if there is underlying script that uses GotoView. If Show Popup is set to TRUE and GotoView is used, the view is opened in a new browser window. The Siebel client UI does not support a Multiple Document Interface (MDI) architecture, so this combined configuration and scripted call to GotoView is not supported.

Used With

Server Script

Example

The following examples show how to use GoToView with and without the optional business object parameter.

The following example is in Siebel eScript.

function BusComp_WriteRecord ()
{
   var leadQuality;
   var actName;
   var actBO;
   var actBC;

   //Get the lead quality for this opportunity
   leadQuality = this.GetFieldValue("Quality");
   if(leadQuality == "1-Excellent")
   {

      //If it is a excellent lead,
      //go to the account for this opportunity
      actName = this.GetFieldValue("Account");
      actBO = TheApplication().GetBusObject("Account");
      actBC = actBO.GetBusComp("Account");

      with (actBC)
      {
         SetViewMode(AllView);
         ClearToQuery();
         SetSearchSpec("Name", actName);
         ExecuteQuery();
      }

      TheApplication().GotoView("All Account List View",actBO);

   }
   else
   {
      TheApplication().GotoView("Opportunity Detail - Activities View");
   }

   actBC = null;
   actBO = null;

}

The following example is in Siebel VB.

Sub BusComp_WriteRecord

   Dim leadQuality As String
   Dim actName As String
   Dim actBO As BusObject
   Dim actBC As BusComp

   'Get the lead quality For this opportunity
   leadQuality = Me.GetFieldValue("Quality")
   If (leadQuality = "1-Excellent") Then

      'If it is a excellent lead
      'go To the account For this opportunity
      actName = Me.GetFieldValue("Account")
      Set actBO = TheApplication.GetBusObject("Account")
      Set actBC = actBO.GetBusComp("Account")

      With actBC
         .SetViewMode AllView
         .ClearToQuery
         .SetSearchSpec "Name", actName
         .ExecuteQuery
      End With

      TheApplication.GotoView "All Account List View",actBO

   Else
      TheApplication.GotoView "Opportunity Detail - Activities View"
   End If

   Set actBC = Nothing
   Set actBO = Nothing

End Sub

Siebel Object Interfaces Reference