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

SetViewMode


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

Siebel VB Syntax

oBusComp.SetViewMode mode

Siebel eScript Syntax

oBusComp.SetViewMode (mode)

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

SiebelViewMode 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 records for the organization where a valid owner has been assigned to the record. Example: All Accounts. Typically used by administrators.
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. Example: All Accounts Across Organizations. Typically used by executives.
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

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

See Also

GetViewMode

Example

Here is a Siebel VB example. For another example, see BusComp_PreDeleteRecord.

(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
   .ActivateField "Name"
   .SetSearchSpec "Name", Me.GetFieldValue("Name")
   .SetSearchSpec "Id", "<> " & Me.GetFieldValue("Id")
   .ExecuteQuery ForwardOnly
   If .FirstRecord Then
      theApplication.Trace"Entry for name " & Me.GetFieldValue("Name")exists already"
   End If
End With
Set oBC = Nothing
Set oBO = Nothing

Here is the same example in Siebel eScript.

var oBO = TheApplication().GetBusObject(this.BusObject.Name);
var oBC = oBO.GetBusComp(this.Name);
with (oBC)
{
   SetViewMode(SalesRepView);
   ClearToQuery();
   ActivateField("Name");
   SetSearchSpec("Name", this.GetFieldValue("Name"));
   SetSearchSpec("Id", "<> " + this.GetFieldValue("Id");
   ExecuteQuery(ForwardOnly);
   if (FirstRecord)
      theApplication().Trace("Entry for name " + this.GetFieldValue("Name") + " exists already")
}
oBC = null;
oBO = null;


 Siebel Object Interfaces Reference 
 Published: 18 June 2003