Siebel Object Interfaces Reference > Interfaces Reference > Business Component Methods >

SetViewMode Method


SetViewMode sets the visibility type for the business component. This is used prior to a query.

Syntax

BusComp.SetViewMode mode

where mode is a Siebel ViewMode constant or its corresponding integer value. The constants shown are defined in three environments.

NOTE:  It is recommended that you use constants, rather than integer values, because integer values are subject to change.

Siebel ViewMode constants correspond to applet visibility types. For more information about applet visibility types, see Siebel Security Guide.

Siebel ViewMode Constant
Integer Value
Comments

SalesRepView

0

Applies single position or sales team access control, and displays records owned by the user's position or records whose sales team contains the user's position, as determined by the business component's Visibility field or Visibility MVField. To use this visibility applet type, the business component must have a view mode with an Owner Type of Position.

ManagerView

1

Displays records that the user and the user's direct reports have access to. Example: My Team's Accounts. Typically used by managers.

If the business component on which the view is based uses single position access control, then this constant displays records associated directly with the user's active position and with subordinate positions.

If the business component on which the view is based uses sales team access control, then this constant displays records for which the user's active position is the primary position on the team or a subordinate position is the primary member on the team.

If a user's position has no subordinate positions, then no data is displayed, not even the user's own data.

To use this visibility applet type, the business component must have a view mode with an Owner Type of Position.

PersonalView

2

Displays records the user has direct access to, as determined by the business component's Visibility field. To use this visibility applet type, the business component must have a view mode with an Owner Type of Person. Example: My Accounts. Typically used by individual contributors.

AllView

3

Displays all records for which there is a valid owner. Example: All Accounts Across Organizations.

OrganizationView

5

Applies single-organization or multiple-organization access control, as determined by the business component's Visibility field or Visibility MVField. To use this visibility applet type, the business component must have a view mode with an Owner Type of Organization. Displays records for organizations where a valid owner has been assigned to the record and the user's position is associated with the organization. Example: All Accounts List View.

GroupView

7

Displays either a list of the category's first level subcategories (child categories) to which the user has access or displays records in the current category, depending on the applet being used. If the user is at the catalog level, then this displays the first level categories.

CatalogView

8

Displays a flat list of records in categories across every catalog to which the user has access. To use this visibility applet type, the business component must have a view mode with an Owner Type of Catalog Category. Typically used in product pick lists and other lists of products, such as a recommended product list.

SubOrganizationView

9

If the business component on which the view is based uses single organization access control, then this constant displays records associated directly with the user's active organization or with a descendent organization. Descendent organizations are defined by the organization hierarchy. To use this visibility applet type, the business component must have a view mode with an Owner Type of Organization.

If the business component on which the view is based uses multiple organization access control, then this constant displays records for which the user's active organization or a descendent organization is the primary organization.

Example: All Opportunities Across My Organization. Typically used by executives.

Returns

Not applicable

Used With

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

Related Topic

GetViewMode Method

Example

The following example is in Siebel VB. For another example, see BusComp_PreDeleteRecord Event.

(general)
(declarations)
Option Explicit
Dim oBO as BusObject
Dim oBC as BusComp

Set oBO = TheApplication.GetBusObject(Me.BusObject.Name)
Set oBC = oBO.GetBusComp(Me.Name)
With oBC
   .SetViewMode SalesRepView
   .ClearToQuery
   .SetSearchSpec "Name", Me.GetFieldValue("Name")
   .SetSearchSpec "Id", "<> " & Me.GetFieldValue("Id")
   .ExecuteQuery ForwardOnly
   If .FirstRecord Then
      TheApplication.Trace"Entry for name " & Me.GetFieldValue("Name") & " exists."
   End If
End With

Set oBC = Nothing
Set oBO = Nothing

The following is the equivalent example in Siebel eScript:

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

TheApplication().TraceOn("c:\\trace.txt","Allocation","All");
with (oBC)
{
   SetViewMode(SalesRepView);
   ClearToQuery();
   SetSearchSpec("Name", this.GetFieldValue("Name"));
   SetSearchSpec("Id", "<> " + this.GetFieldValue("Id");
   ExecuteQuery(ForwardOnly);
   if (FirstRecord())
      TheApplication().Trace("Entry for name " + this.GetFieldValue("Name") + " exists.");
}

TheApplication().TraceOff();
oBC = null;
oBO = null;

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