SetViewMode Method for a Business Component
The SetViewMode method sets the visibility type for a business component. This method does not return any information. For more information, see GetViewMode Method for a Business Component.
Format
BusComp.SetViewMode mode
The following table describes the arguments for the SetViewMode method.
Argument | Description |
---|---|
mode |
A Siebel ViewMode constant or the corresponding integer value for the constant. More information about the constants that you can use with the SetViewMode method is provided later in this topic. |
Siebel ViewMode constants correspond to applet visibility types. For more information about applet visibility types, see Siebel Security Guide.
Constants You Can Use with the SetViewMode Method
The following table describes the constants you can use with the SetViewMode method. The Owner Type column indicates the value that must be set in the Owner Type property of the BusComp view mode object of the business component. For more information, see Use Constants to Standardize Code.
Siebel ViewMode Constant | Integer Value | Owner Type | Description |
---|---|---|---|
SalesRepView |
0 |
Position |
This constant does the following:
|
ManagerView |
1 |
Position |
Displays records that the user and the users who report to the user can access. For example, the records that Siebel CRM displays in the My Team’s Accounts visibility filter. If the business component that the view references uses single position access control, then this constant displays records that Siebel CRM associates directly with the active position of the user and with subordinate positions. If the business component that the view references uses sales team access control, then this constant displays records according to one of the following positions:
If the user position does not include a subordinate position, then Siebel CRM does not display any records. |
PersonalView |
2 |
Position |
Displays records that the user can access, as determined by the Visibility Field property of the BusComp view mode object. For example, the records that Siebel CRM displays in the My Accounts visibility filter. |
AllView |
3 |
Not applicable |
Displays all records that includes valid owner. For example, the records that Siebel CRM displays in the All Accounts Across Organizations visibility filter. |
OrganizationView |
5 |
Position |
Displays records where a valid owner is associated with the record and the user position is associated with the organization. For example, the records that Siebel CRM displays in the All Accounts List View visibility filter. Applies access control for a single organization or for multiple organizations, as determined by the Visibility field or Visibility MVField of the BusComp view mode object of the business component. |
GroupView |
7 |
Not applicable |
This constant does one of the following:
|
CatalogView |
8 |
Catalog Category |
Displays a list of records in categories across every catalog that the user can access. Siebel CRM typically uses this visibility in a product picklist and other list of products, such as a recommended product list. |
SubOrganizationView |
9 |
Organization |
If the business component that the view references uses single organization access control, then this constant displays records that Siebel CRM associates directly with one of the following organizations:
For example, the records that Siebel CRM displays in the All Opportunities Across My Organization visibility filter. If the business component that the view references uses multiple organization access control, then this constant displays records for the primary active organization or for the primary descendent organization. |
Used With
COM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script
Examples
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;