OIRef
OIRef
The Programs (which include both the software and documentation) contain proprietary information;
they are provided under a license agreement containing restrictions on use and disclosure and are also
protected by copyright, patent, and other intellectual and industrial property laws. Reverse engineering,
disassembly, or decompilation of the Programs, except to the extent required to obtain interoperability
with other independently created software or as specified by law, is prohibited.
The information contained in this document is subject to change without notice. If you find any problems
in the documentation, please report them to us in writing. This document is not warranted to be error-
free. Except as may be expressly permitted in your license agreement for these Programs, no part of
these Programs may be reproduced or transmitted in any form or by any means, electronic or
mechanical, for any purpose.
PRODUCT MODULES AND OPTIONS. This guide contains descriptions of modules that are optional and
for which you may not have purchased a license. Siebels Sample Database also includes data related to
these optional modules. As a result, your software implementation may differ from descriptions in this
guide. To find out more about the modules your organization has purchased, see your corporate
purchasing agent or your Oracle sales representative.
If the Programs are delivered to the United States Government or anyone licensing or using the Programs
on behalf of the United States Government, the following notice is applicable:
U.S. GOVERNMENT RIGHTS. Programs, software, databases, and related documentation and technical
data delivered to U.S. Government customers are "commercial computer software" or "commercial
technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific
supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the
Programs, including documentation and technical data, shall be subject to the licensing restrictions set
forth in the applicable Oracle license agreement, and, to the extent applicable, the additional rights set
forth in FAR 52.227-19, Commercial Computer Software--Restricted Rights (June 1987). Oracle USA,
Inc., 500 Oracle Parkway, Redwood City, CA 94065.
The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently
dangerous applications. It shall be the licensee's responsibility to take all appropriate fail-safe, backup,
redundancy and other measures to ensure the safe use of such applications if the Programs are used for
such purposes, and we disclaim liability for any damages caused by such use of the Programs.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be
trademarks of their respective owners.
The Programs may provide links to Web sites and access to content, products, and services from third
parties. Oracle is not responsible for the availability of, or any content provided on, third-party Web sites.
You bear all risks associated with the use of such content. If you choose to purchase any products or
services from a third party, the relationship is directly between you and the third party. Oracle is not
responsible for: (a) the quality of third-party products or services; or (b) fulfilling any of the terms of
the agreement with the third party, including delivery of products or services and warranty obligations
related to purchased products or services. Oracle is not responsible for any loss or damage of any sort
that you may incur from dealing with any third party.
For Oracle internal distribution only
Contents
Chapter 3: Programming
About Programming with Siebel Object Interfaces 27
About Siebel Object Interfaces 28
Siebel COM Interfaces 28
Siebel Java Interfaces 32
Built-In Scripting 32
Usage Evaluation Matrix 33
Installing Siebel Object Interfaces 33
Exposed Object Types 34
Application Object Type 34
Business Object Object Type 34
Business Component Object Type 35
Business Service Object Type 35
Applet Object Type 36
Property Set Object Type 36
User Interface Control Object Type 36
Property Set Methods for Siebel Web Client Automation Server 375
Index
Topic Description
About the Siebel Script Profiler on The Siebel Script Profiler displays data for all the scripts
page 20 executed when an application is launched in Debug mode
from Siebel Tools, allowing developers to monitor and
improve script performance. For more information, see Using
Siebel Tools.
Accessing the Siebel Web Client You cannot invoke the Siebel Web Client Automation Server
Automation Server on page 40 directly from the active Siebel instance.
Instantiating the Java Data Bean Updated the connect string to include explicitly the port for
on page 48 the SCBroker component.
Java Data Bean and the The maximum possible value for both
siebel.properties File on page 49 siebel.conmgr.txtimeout and siebel.conmgr.sesstimeout in
the siebel.properties file is the largest positive integer,
2,147,483,647.
Connect String on page 71 Removed the http transport protocol, which is not valid for
connect strings.
Using Load Balancing with the When the COM Data Control operates in Server Mode in an
Connect String on page 73 environment that implements load balancing, the
VirtualServer parameter in the connect string must match the
VirtualServer parameter in the session manager rules in the
lbconfig.txt file.
Name Method on page 98 Changed the function name in the Browser Script example to
Applet_Load.
GetSharedGlobal Method on This method and the SetSharedGlobal method are not used
page 134 with the Java Data Bean. Use GetProfileAttr and SetProfileAttr
instead.
LoadUserAttributes Method on If the row ID argument is the row ID of the current user, the
page 144 user profile will be loaded into the Me profile.
SetProfileAttr Method on page 158 Added a note that system fields cannot be used with this
method.
Topic Description
ExecuteQuery Method on Added a note that you must activate fields by using the
page 190 ActivateField method before executing a query for a business
component.
FirstRecord Method on page 192 Added a note that this method can cause extra SQL code to
be generated.
Service_PreInvokeMethod Event Added a note that Browser Script does not support output
on page 284 property sets with this event.
This chapter describes the Siebel programming tools. It contains the following topics:
The languages are integrated with other Siebel tools, such as the Applet Designer, Siebel CTI, and
Siebel SmartScript. Using this integration you can define object properties both with the designer
and by attaching scripts.
You should regard coding as a last resort. Siebel Tools provides many ways to configure your Siebel
application without coding, and these methods should be exhausted before you attempt to write your
own code, for three reasons:
More important, your code may not survive an upgrade. Customizations created directly in Siebel
Tools are upgraded automatically when you upgrade your Siebel application, but code is not
touched, and it may need to be reviewed following an upgrade.
Finally, declarative configuration through Siebel Tools results in better performance than
implementing the same functionality through code. For more information, see Siebel
Performance Tuning Guide.
Server Script:
Siebel VB language. A programming language that is syntactically and semantically
compatible with Microsoft Visual Basic. Because the language uses most of the same
commands and standards as Microsoft Visual Basic, you can extend your Siebel application
and reduce training costs.
Browser Script. A type of script (introduced in Siebel 7) that executes in and is interpreted by
the Browser. Browser Scripts are written in JavaScript and interact with the Document Object
Model (DOM) as well as with the Siebel Object Model available in the Browser through the
Browser Interaction Manager. A developer can script the behavior of Siebel events as well as the
Browser events that are exposed through the DOM. Be aware that the DOMs for Internet Explorer
and Netscape Navigator are different. Browser Script may only be used with applications which
run in high interactivity mode, except when scripting Control events supported by the Browser
Document Object Model.
Siebel Script Editor. An integrated editor used to create, view, edit, and save custom program
routines. The script editor has a code editing feature called Script Assist (introduced in version
7.8). Script Assist provides auto-complete, auto-indentation, method listing, and method
signature capabilities to help minimize errors as you develop script. For more information about
the Siebel Script Editor, including how to enable Script Assist, see Using Siebel Tools.
Siebel Debugger. Assists you in detecting errors contained within Siebel programming
language routines. It does not assist in detecting errors outside of the context of custom program
routines. The Siebel Debugger can be invoked automatically from Siebel applications when a run-
time error occurs if the Siebel application was invoked with the debug option, /H, on the
command startup line. The Debugger can also be invoked from the Debug toolbar and Debug
menu. The Debugger is described in more detail in Using Siebel Tools.
Object Interfaces. A collection of selected objects that expose their data and functionality to
custom routines. The interface provides access to Siebel business objects with defined methods,
events, and associated data. The object interfaces are the subject of this book.
Data validation routines can incorporate validations based on data from sources within or outside the
Siebel application. For example, a validation routine might verify that an opportunity revenue
amount is greater than zero if the probability of the opportunity is more than 20 percent using
internal Siebel data. Alternatively, an extension routine could verify the availability of a conference
room prior to inserting a new activity record by reading the information from another applications
database table.
The Siebel programming languages provide data manipulation capabilities that can be used to modify
data, such as updating, inserting, and deleting records. For example, a custom routine can be used
to set the value of one field based on the value of another before a new record is created. A custom
routine could thus be used to set the value of opportunity probability based on a stage in the sales
cycle, simplifying data entry.
The methods used to support data manipulation provide error notification. The Siebel programming
language is notified of the error and has access to information so you can handle the error and take
appropriate action.
Data manipulation methods in the Siebel programming languages conform to the same visibility rules
as the standard Siebel applications user interface. For example, if a business object is readable but
not editable because of visibility rules in the Siebel applications user interface, the same is true when
you are accessing the object through the Siebel languages. These languages cannot circumvent the
visibility rules or the security constraints enforced by the standard Siebel applications.
With the Siebel programming languages, you can update a particular field based on the values of
other fields. An extension routine could enforce the business rule that states, If the sales cycle is
at or past the Quote Submitted stage, do not allow the Revenue field to be modified. The feature
can also be used to support the user-specific data maintenance rule by restricting updates to certain
fields based on the current users position.
2 Choose Repository > Check Out to lock the project from the server repository.
3 Select the business component using the Object Explorer and Object List Editor.
4 Right-click, and then choose Edit Browser Scripts or Edit Server Scripts.
5 Select the event from the Event List Tree applet, and then add your server scripts in the Script
Editor.
6 Validate the Siebel script syntax by choosing Debug > Check Syntax.
NOTE: The Check Syntax menu item is available for server scripts only.
10 Choose Repository > Check In to check the modified project into the server repository.
Tracing Scripts
As part of debugging scripts you can run a trace on allocations, events, and SQL commands. The
tracing can be activated for specified user accounts, such as your development team. The Siebel
Server sends the tracing information to a log file.
For more information on configuring server components, see Siebel Applications Administration
Guide. For information on logging events, see Siebel System Monitoring and Diagnostics Guide.
To enable logging
1 Navigate to Server Configuration > Components.
2 Select a component to log. Not all components support logging, but the majority do.
4 Select the Object Manager Extension Language Log record. If this record does not exist, then the
selected component does not support logging.
5 Set the Log Level to 1. To disable logging when you are done, set the Log Level to 0 (zero).
7 Optional. To display only the script tracing parameters, query for the following:
Changes to the script tracing parameters can take effect immediately. If you want changes to
take effect now, then make changes to the values in the Current Value column. If you want the
changes to take effect only after a restart, then make changes to the values in the Value on
Restart column.
Information to
Trace Parameter Alias Settings for Current Value and Value on Restart
Script tracing is not the same as file-based tracing. For more information on file-based tracing, read
Trace Method on page 165.
NOTE: You can also enable local object manager logging by setting the SIEBEL_LOG_EVENT
environment variable to a value from 2 to 5. For more information on setting environment variables,
see Siebel Applications Administration Guide.
The profiler data is displayed in a window in Siebel Tools (similar to the Watch window), and is
automatically updated whenever any script executes in the attached application.
Ability to use the Siebel Debugger and Script Profiler at the same time
Using this data, developers can monitor the performance of their scripts, identify performance
bottlenecks, and compare profiling data with previous script executionsallowing them to improve
their scripts.
NOTE: The Script Profiler can only be used with the ST eScript Engine.
For more information on the Siebel Script Profiler, see Using Siebel Tools.
To avoid this error, use the Declare statement to declare the function or procedure in the (general)
(declarations) section. For more information, read Siebel VB Language Reference.
ST eScript Engine
In version 7.8 and higher, the ST eScript engine is available. It is the default eScript scripting engine
in version 8.0. The new engine provides support for strongly typed objects (compliant with the
ECMAScript edition 4 specification). In addition, the new eScript engine provides other
enhancements, such as late and early binding. For information about the differences between the ST
eScript engine and the T engine, see Siebel eScript Language Reference. For information on using
the ST engine, see Using Siebel Tools.
About Siebel VB
If you have never programmed in Visual Basic before, you may want to start by reading Siebel VB
Language Reference. It includes information on the internal VB program constructs, statements, and
functions. You need to understand how these objects behave before you can program using the
Siebel object methods and events.
Declare your variables. As a general rule, using the Option Explicit statement is helpful as it forces
you to declare your variables (using the Dim statement) before you use them. Doing so makes it
easier for others to understand your code, and for you to debug the code. You can declare a variable
without giving it a data type, but if you do not specify a data type, Siebel VB assumes the type
Variant, which requires 16 bytestwice as much memory as the next smallest data type. If you can
avoid Variant variables, you reduce the amount of memory required by your code, which may make
execution faster. In Siebel VB, you place Option commands in the (general) (declarations) window.
Use standardized naming conventions. Another way to improve the readability of your code is
to follow a set of standardized naming conventions. It does not really matter what conventions you
follow as long as everyone in the programming group follows the same conventions. One very
common convention is to prefix each variable with a letter denoting its type, as shown in Table 2.
String s sName
Integer i iReturn
Object o oBusComp
Currency c cAmtOwed
Use the Me object reference. The special object reference Me is a VB shorthand for the current
object. You should use it in place of references to active business objects. For example, in a business
component event handler, you should use Me in place of ActiveBusComp, as shown in the following
example:
End Function
You can see other examples of Me in ParentBusComp Method on page 224, SetViewMode Method
on page 245, BusComp_PreQuery Event on page 260, BusComp_PreWriteRecord Event on page 263,
and ActiveMode Method on page 92.
Trap run-time errors. The standard VB methods return numeric error codes, which are documented
in Siebel VB Language Reference. Siebel VB methods also may return error codes; however, they
must be handled differently from those returned by the standard VB methods. For standard methods,
you can use some combination of Err, ErrText, and Error. Siebel methods use numeric error codes in
the range from 4000 to 4999. When you access Siebel object interfaces through COM or ActiveX, use
a construct of this form to see the text of the error message.
Exit Sub
End If
NOTE: The GetLastErrText method is only available using interfaces external to Siebel Tools.
Therefore, you can use it in Microsoft VB, but not in Siebel VB.
If you are working within the Siebel applications, especially in a LAN environment, where you cannot
be sure that a record has not been changed or deleted by another user, create routines that keep
the program from failing when it meets an unexpected condition. For information about error-
handling routines, see the Language Overview topics in Siebel VB Language Reference.
Make effective use of the Select Case construct. The Select Case construct chooses among any
number of alternatives you require, based on the value of a single variable. This is greatly preferable
to a series of nested If statements, because it simplifies code maintenance and also improves
performance because the variable must be evaluated only once.
Use the With shortcut. Use the With statement to apply several methods to a single object. It
reduces typing and makes the code easier to read. Instead of a series of statements such as:
Use extreme care when working with date variables. When working with date variables
extreme care has to be taken regarding the date format. GetFieldValue always returns the date in
dd/mm/yyyy format (eventually followed by the time). As a result, applying the CVDate() function,
which expects the regional setting, to the return value may cause an error. The
GetFormattedFieldValue method uses the regional settings of the users operating system. The
regional setting specifies the year with two digits in most cases, thereby creating the possibility of
Y2K noncompliance. For these reasons, you should use the following approach for performing date
arithmetic.
Destroy any objects you have created when you no longer need them. While the interpreter
takes care of object cleanup, it is a best practice to write code that explicitly destroys objects when
they are no longer used. Explicit destruction of Siebel objects should occur in the procedure in which
they are created.
To destroy objects in Siebel VB, set each object to Nothing in the reverse order of creation. Destroy
child objects before parent objects. For example:
Siebel eScript does not distinguish between subroutines (which take no arguments) and
functions (which take arguments). In Siebel eScript, every method is a function, whether or not
it accepts arguments; therefore, it should be followed by a pair of parentheses.
Keep these differences in mind when you read the syntax diagrams. In many instances, the only
difference between the VB syntax and the eScript syntax is that the eScript syntax requires the pair
of parentheses at the end. In these instances, only the VB syntax is shown; you can derive the
eScript syntax by adding the parentheses.
There are also some important differences between Siebel eScript and standard ECMAscript. Most
important, Siebel eScript has no user interface functions. It cannot, therefore, be used to animate
or control Web pages. Second, it contains two objects that are not part of standard ECMAscript: SELib
and Clib. These objects implement a variety of C-like functions for interacting with the operating and
file systems, and for file I/O. For details on these and other eScript functions not covered here, see
Siebel eScript Language Reference.
Declare your variables. Standard ECMAscript does not require that you declare variables. Variables
are declared implicitly as soon as they are used. As a general rule, you should declare the variables
used in a module before you use them. Doing so makes it easier for others to understand your code,
and for you to debug the code.
Use standardized naming conventions. Another way to improve the readability of your code is
to follow a set of standardized naming conventions. It does not really matter what conventions you
follow as long as everyone in the programming group follows the same conventions. One very
common convention is to prefix each variable with a letter denoting its type, as shown in Table 2 on
page 22.
Use the this object reference. The special object reference this is eScript shorthand for the
current object. You should use it in place of references to active business objects and components.
For example, in a business component event handler, you should use this in place of ActiveBusComp,
as shown in the following example:
if (condition)
{ ...
this.SetSearchSpec(...);
this.ExecuteQuery
return (CancelOperation)
}
else
return(ContinueOperation);
Use the with shortcut. The with shortcut applies several methods to a single object. It reduces
typing and makes the code easier to read. Instead of a series of statements such as:
Make effective use of the Switch construct. Use the Switch construct to choose among any
number of alternatives you require, based on the value of a single variable. This is greatly preferable
to a series of nested If statements because it simplifies code maintenance. It also improves
performance because the variable must be evaluated only once.
switch (FieldName)
{
case "Status":
{
var sysdate = new Date();
var sysdatestring = ((sysdate.getMonth() + 1) + "/" + sysdate.getDate() +
"/" + sysdate.getFullYear()+ " "+ sysdate.getHours() + ":" +
sysdate.getMinutes()+":" + sysdate.getSeconds());
this.SetFieldValue("Sales Stage Date",sysdatestring);
if ((FieldValue) == "Not Attempted")
{
if (this.GetFieldValue("Primary Revenue Amount") > 0)
this.SetFieldValue("Primary Revenue Amount",0);
}
break;
}
case "Revenue":
{
if (newrecSw =="Y")
{
newrecSw = "";
this.SetFieldValue("Account Revenue",(FieldValue));
}
break;
}
}
Destroy any objects you have created when you no longer need them. While the interpreter
takes care of object cleanup, it is a best practice to write code that explicitly destroys objects when
they are no longer used. Explicit destruction of Siebel objects should occur in the procedure in which
they are created.
To destroy objects in Siebel eScript, set each object to null in the reverse order of creation. Destroy
child objects before parent objects. For example:
oBusComp = null;
oBusObject = null;
3 Programming
This chapter provides information about installing and using Siebel object interfaces:
Siebel object interface definitions are based on Siebel business objects and declarative object
definitions that can be configured and automatically upgraded to successive releases using Siebel
Tools.
Siebel object interfaces are available to developers through the following technologies:
Built-in scripting of Siebel objects using Siebel VB, Siebel eScript, and Browser Script
Component Object Model (COM) using the Siebel Web Client Automation Server, Siebel COM Data
Control, Siebel COM Data Server, and Siebel Mobile Web Client Automation Server
Siebel developers can integrate client and server applications from a variety of vendors. Application
integration typically requires that cooperative software application programs interactively pass data
back and forth. In addition, application integration sometimes requires that one application
controls or automates another application.
The Siebel object interfaces are a collection of methods on Siebel objects that expose their data and
functions to custom routines written in Server Script, and also to other languages external to the
Siebel application. The interfaces provide access to Siebel business objects with defined methods,
events, and data.
CAUTION: Your Siebel application is a Web-based or client/server application designed to meet the
sales and marketing information requirements of large multinational corporations. Use caution when
extending the Siebel applications or accessing them through the interface described here, as this
should be done only by trained technical professionals. Improper application configuration or use of
these interfaces can cause your configured Siebel application to be less reliable, or to perform poorly.
Always test your configured application thoroughly before production rollout.
In addition, Siebel business objects, the Siebel object interfaces, and their associated behavior and
properties are defined at the sole discretion of Oracle. Oracle reserves the right to change the
behavior, properties, and events at any time without notice.
This chapter describes the interface environments and object types. Chapter 4, Interfaces Reference
describes the supported methods of the Siebel object interfaces and provides examples of how you
can use them.
Built-in scripting of Siebel objects using Siebel VB, Siebel eScript, and Browser Script. For more
information, read Built-In Scripting on page 32.
Related Topic
Usage Evaluation Matrix on page 33
The supported languages for accessing Siebel COM interfaces are JavaScript, Visual Basic, and C++.
The Perl language is not supported with Siebel COM interfaces.
NOTE: The programming environment you use may impose limitations on the functionality of COM
servers. For example, code using the Data Server written in VB should not be implemented as a
Windows NT service.
To develop an application using the Siebel COM Data Control, you must have a Siebel Application
Object Manager set up and running on a Siebel Server. Refer to Siebel System Administration Guide
for information about installing and configuring the Siebel Object Manager.
Any external application or component that uses Siebel COM Data Control connects and
communicates with Siebel Application Object Manager using the SISNAPI protocol. The Siebel
Application Object Manager, which could be running on a remote Siebel Server, is a multithreaded,
multiprocess application server that hosts Siebel business objects and supports session-based
connections by clients. Figure 1 shows how external applications use Siebel COM Data Control to
communicate with the Siebel application.
You can expect differences in performance between Siebel COM Data Server and Siebel Mobile Web
Client Automation Server. This is due in part to the fact that COM Data Server is a DLL running in
the same address space as the calling program, while Automation Server is an executable that runs
in its own address space. DLLs that are accessed by a server task must be thread safe.
To enable the Web Client Automation Server, make sure that the EnableWebClientAutomation
parameter is set to TRUE in the [SWE] section of the applications configuration file. With this
parameter set to TRUE, a small ActiveX Control downloads to the desktop and the
SiebelHTMLApplication process starts.
In the Windows Task Manager, this process is named one of the following:
siebelhtml.exe
siebelhtmlapplication.exe
SIEBEL~1.EXE
This process terminates when the Siebel Web Client is gracefully terminated. You may need to modify
the ActiveX controls and plug-ins security settings in the Browser to use the Web Client Automation
Server.
Figure 3 shows how external applications can invoke business services and manipulate property sets
in the Siebel Web Client Automation Server.
Any external application that uses the Siebel Java Data Bean connects and communicates with a
Siebel Application Object Manager using the SISNAPI protocol. The Siebel Application Object
Manager, which could be running on a remote Siebel Server, is a multithreaded, multiprocess
application server that hosts Siebel objects and supports session-based connections by clients. The
Siebel Application Object Manager specified in the connect string must be running on the specified
Siebel Server.
For the same reasons, you should not reuse instances of any other objects exposed by the Java Data
Bean (SiebelBusObject, SiebelBusComp, SiebelService, and SiebelPropertySet) across multiple
threads of the same process.
CAUTION: You should create one instance of the Siebel Java Data Bean for each thread that wishes
to use it. Data Bean Objects obtained by one thread should not be shared among multiple threads.
Built-In Scripting
You can access Siebel methods and events from within the Siebel application through Siebel VB or
Siebel eScript. Both languages are procedural programming languages for writing custom extensions
that access and control Siebel objects through the Siebel object interfaces.
NOTE: Throughout this guide, X in a table denotes that an object interface type can be used with a
specified method or object type, or for a specified purpose.
Mobile Web
Web Client Client Siebel Siebel
Automation Automation COM Data COM Data Siebel Java
Usage Server Server Control Server Data Bean
Objects execute on a X X X
Siebel Server
Interface Installation
Java Data Bean Installed by the Siebel Enterprise Server Installer under a
Typical installation, with the EAI Siebel Connectors option.
Also installed by default with Siebel Tools.
COM Data Control Installed by the Siebel Enterprise Server Installer under a
Typical installation, with the EAI Siebel Connectors option.
COM Data Server Installed by default with the Mobile Web Client.
Interface Installation
Siebel Mobile Web Client Installed by default with the Siebel Mobile Web Client.
Automation Server
Siebel Web Client Automation Installed by default with the Siebel Mobile Web Client. Also
Server installed by default with the Siebel Enterprise Server
Installer.
There are additional object types used in Siebel Business Applications, including specialized types
derived from the base object types. However, object types not specifically discussed here are not
exposed in the Siebel object interfaces and references to them may not be passed to external DLLs,
such as a Microsoft Visual Basic COM DLL.
A Siebel business object groups one or more business components into a logical unit of information.
Examples of Siebel business objects include Opportunity, Quote, Campaign, and Forecast. An
opportunity business object may consist of opportunity, contact, and product business components.
The opportunity business component dictates the information of the other business components in
a parent-child relationship.
Business component objects have associated data structured as records, they have properties, and
they contain data units called fields. In the object interfaces, fields are accessed through business
components. The business component object supports getting and setting field values, moving
backward and forward through data in a business component object, and filtering changes to data it
manages. This object type is available to every interface.
Built-in business services, which are defined in Siebel Tools and stored in the repository.
Run-time business services, which are defined in the run-time client and stored in the application
database.
Standard, which are based on the class CSSService and can be scripted or modified.
Specialized, which are based on specialized C++ classes. Those specialized services whose
behavior has been documented can be scripted.
Using business services, you can configure stand-alone objects or modules with both properties
and scripts (written in VB or eScript). Business services may be used for generic code libraries that
can be called from any other scripts.
Built-in services cannot be modified at run time, and they cannot be overridden by run-time scripts.
User-created services can be created by adding a new record to the Business Service list applet in
Siebel Tools. They can also be defined by administrators at run time by using views in the Siebel
client. They can have whatever properties are needed to accomplish a particular task. They can be
called either from scripts or from object interfaces.
NOTE: To invoke a business service using the Web Client Automation Server and Browser Script, the
business service must first be registered in Siebel Tools as an application user property. This prevents
Service Not Found errors. For more information, see GetService Method on page 131.
Because they are reusable and can be set to persist throughout a session, business service objects
can be used to simulate global procedures.
An applet object represents an applet that is rendered by the Siebel Web Engine. It exists only as a
scriptable object, and is accessed by using the Edit Server Scripts or Edit Browser Scripts command
on the selected applet. Applet objects are accessible through Siebel VB and Siebel eScript in Server
Scripts, and through Browser JavaScript in Browser Scripts. Some Applet Events, such as
WebApplet_ShowControl and WebApplet_ShowListColumn, do not execute if the client is running in
high interactivity mode.
2 In the right pane, locate the object to which you want to add a script.
4 Right-click the item and select Edit Server Scripts or Edit Browser Scripts.
Controls are the visible building blocks of applets. Each control is unique and exists only in a single
applet. Only controls on the active (currently visible) applet are available to Siebel Browser Script.
Each control has a unique name within its containing applet, but control names need not be unique
across applets.
The control object supports getting and setting values and customized behavior when used in
conjunction with Siebel Browser Script.
Siebel
Siebel Web Mobile Web Siebel Siebel Siebel
Client Client COM COM Java
Object Server Browser Automation Automation Data Data Data
Type Script Script Server Server Control Server Bean
Applet X X
Application X X X X X X X
Business X X X X X X
Component
Business X X X X X X
Object
Business X X X X X X X
Service
Property Set X X X X X X X
Control X
Syntax
ObjectType.MethodName(arg1[, arg2, , argn])
Argument Description
. .
. .
Returns
Description of the value returned by the method, if any.
ObjectType is the object type, for example BusComp (business component), for which the
method is defined.
MethodName is the name of the method that is being invoked. A method can be a subroutine
that does not return a value, such as SetViewMode, or a function that returns a value, such as
GetFieldValue.
arg1, arg2 can be a string, constant, integer, or object. If a method returns a value, the
arguments must be enclosed in parentheses in Siebel VB. In Siebel eScript, enclose arguments
in parentheses, even if they do not return a value.
Brackets [ ] indicate an optional argument. In the description of the argument, the default value
for the optional argument is indicated.
If a method does not return a value or if you are using it in a manner that does not return a value,
then the arguments should not be enclosed in parentheses in Siebel VB.
When using COM Data Server, an additional argument, errCode, is always required as the last
argument.
Usage Syntax
The usage syntax for a method may differ between Server Script and COM, as described in the text
that follows. The description uses the following terms in addition to the ones defined previously:
ObjectReference is a variable name of type ObjectType that points to the object on which the
method is invoked.
NOTE: You do not need to explicitly specify an ObjectReference when you invoke a method on
an object inside its event handler.
returnValue is the value, if any, that is returned by the method. Some methods, such as
GetBusComp, return an object of the type business component. Other methods return strings or
integers.
Siebel VB
If there is a return value:
returnValue = ObjectReference.MethodName
Examples
acctName = acctBC.GetFieldValue("Name")
acctBC.SetViewMode AllView
Siebel eScript
If there is a return value:
returnValue = ObjectReference.MethodName();
Examples
acctName = acctBC.GetFieldValue("Name");
acctBC.SetViewMode(AllView);
Using parentheses ( ) when none are required, or failing to use them when they are required,
generates a Type Mismatch (error code 13) message. Another cause of this error code is using an
incorrect quantity of arguments.
COM
The usage depends on the language being used to call the COM Interfaces. For Microsoft Visual Basic
and equivalent languages, the usage is similar to that of Siebel VB, except that an error code is
passed as the final argument in the case of the COM Data Control.
Syntax window
NOTE: You cannot invoke the Siebel Web Client Automation Server directly from the active Siebel
instance. Trying to do so will cause an error.
To set up Microsoft Visual Basic to access the Siebel Web Client Automation Server
1 Start Microsoft Visual Basic.
4 In the list box, highlight and check the SiebelHTML 1.0 Type Library.
The following example shows how to use Microsoft Visual Basic 6.0 with the Siebel Web Client
Automation Server:
The mechanism for instantiating COM servers depends on the programming tool or language being
used.
If you use Microsoft Visual Basic 5.0 or later, the required support file must be in the same directory
as the CFG file you are using for your Siebel application, or the Mobile Web Client Automation Server
does not work. Take the following steps to make sure that you are referring to the correct library.
To set up Microsoft Visual Basic to access the Siebel Mobile Web Client Automation
Server
1 Start Microsoft Visual Basic.
4 In the list box, highlight (check) Siebel Mobile Web Client Automation Server. Near the bottom
of the dialog box, note the directory in which the file Siebel.exe resides.
The following examples show how to use Microsoft Visual Basic 6.0 to interface with Siebel Mobile
Web Client Automation Server.
The following is sample code for the Siebel Mobile Web Client Automation Server:
Else
errCode = siebWebApp.GetLastErrCode
errText = siebWebApp.GetLastErrText
TheApplication().RaiseErrorText("Business Object Creation failed: " & errCode &
"::" & errText);
End If
Else
errCode = siebWebApp.GetLastErrCode
errText = siebWebApp.GetLastErrText
TheApplication().RaiseErrorText("Property Set Creation failed: " & errCode &
"::" & errText);
End If
End Sub
If you use Microsoft Visual Basic 5.0 or later, the required support file, sobjsrv.tlb, must be in the
same directory as the CFG file you are using for your Siebel application, or the COM Data Server does
not work. Take the following steps to make sure you are referring to the correct library.
NOTE: Do not run in the Microsoft VB Debug environment when communicating with the Siebel COM
Data Server.
When using COM Data Server, the COM client cannot create multiple connections to the COM Server.
The COM client must be restarted before another connection attempt can be successful. Use COM
Data Control instead.
To set up Microsoft Visual Basic to access the Siebel COM Data Server
1 Start Microsoft Visual Basic.
4 In the dialog box that appears, click on Siebel Data BusObject Interfaces, but do not check its
checkbox. Near the bottom of the dialog box, note the directory in which the file sobjsrv.tlb
resides, as shown in the following illustration.
5 Select the Siebel Data BusObject Interfaces checkbox, and then click OK.
The following is sample code for the Siebel COM Data Server. Make sure that the DataSource
parameter in the CFG file is set to the database to which you want to connect.
NOTE: This code must be written and executed outside of Siebel Tools, for example in Microsoft
Visual Basic.
ChDrive "D"
ChDir "D:\Server\siebsrvr\bin"
errText = siebApp.GetLastErrText
siebApp.RaiseErrorText("Could not Get Siebel Service: " & errCode & "::" &
errText);
End If
End If
End Sub
To set up Microsoft Visual Basic to access the Siebel COM Data Control Interface
1 Be sure you have installed the Siebel COM Data Control. Read Installing Siebel Object Interfaces
on page 33.
5 In the dialog box that appears, select the Siebel BusObject Interfaces Type Library checkbox.
6 Click OK to open the Object Browser, and then verify that you can see the Siebel objects.
To instantiate and use the Siebel COM Data Control, you must use the CreateObject and Login
methods. You cannot use methods that retrieve active Siebel objects, because there are no currently
active Siebel objects. You must instantiate your own Siebel objects. Calls made to the Siebel COM
Data Control are also in-process.
The following is sample code for the Siebel COM Data Control:
Sub CreateDataControl()
Dim errCode As Integer
Set SiebelApplication = CreateObject("SiebelDataControl.SiebelDataControl.1")
SiebelApplication.Login "host=""siebel://hostname/EnterpriseServer/AppObjMgr""",
"CCONWAY", "CCONWAY"
errCode = SiebelApplication.GetLastErrCode()
If errCode <> 0 Then
ErrText = SiebelApplication.GetLastErrText
TheApplication().RaiseErrorText(ErrText);
Exit Sub
End If
set OpptyB0 = SiebelApplication.GetBusObject("Opportunity",errCode)
set OpptyBC = OpptyBO.GetBusComp("Opportunity", errCode)
End Sub
See Table 19 on page 72 for values to substitute for the placeholders in the login string.
The following sample code instantiates the COM Data Control from a server-side ASP script.
NOTE: The symbols <% and %> are used within HTML script to set off an ASP script.
<%
%>
For more information on instantiating the Siebel COM Data Control, read Connect String on page 71.
A Java client that uses the Java Data Bean interface to connect to the Siebel server needs several
JAR files that provide the objects and methods of the Siebel Object Interface to the Java language.
The JAR files of the Java Data Bean interface are specific to the Siebel application version with which
they were delivered. Do not use these JAR files with other versions of the Siebel server.
NOTE: Prior to compilation or execution, add the Siebel JAR files (Siebel.jar and
SiebelJI_<lang>.jar) to the CLASSPATH.
The following is sample code for the Siebel Java Data Bean:
import com.siebel.data.*;
import com.siebel.data.SiebelException;
public DataBeanDemo()
{
try
{
// instantiate the Siebel Data Bean
m_dataBean = new SiebelDataBean();
// log off
m_dataBean.logoff();
}
catch (SiebelException e)
{
System.out.println(e.getErrorMessage());
}
}
}
NOTE: If you are using a single sign-on (SSO) with Java Data Bean, you must use the login ID of an
employee as the username and the value of the trust token (the TrustToken parameter in the
applications CFG file) in the connect string to log into the server. For more information, see Connect
String on page 71.
NOTE: Java System Properties are System Properties, not Siebel Properties.
siebel.connection.string = siebel.tcpip.rsa.none://test.siebel.com/siebel/
sseobjmgr_enu/test
siebel.user.name = User1
siebel.user.password = password
siebel.user.language = enu
siebel.user.encrypted = false
siebel.conmgr.txtimeout = 3600
siebel.conmgr.poolsize = 5
siebel.conmgr.sesstimeout = 300000
siebel.conmgr.retry = 5
siebel.conmgr.jce = 1
ascii 1
cp1252 1252
iso8859_1 1252
iso8859-1 1252
unicodebig 1201
unicodelittle 1200
utf8 65001
big5 950
cp942 932
cp942c 932
cp943 932
cp943c 932
cp949 949
cp949c 949
cp950 950
cp1250 1250
cp1251 1251
cp1253 1253
cp1254 1254
cp1255 1255
cp1256 1256
cp1257 1257
cp1258 1258
gbk 936
ms874 874
ms932 932
ms936 936
ms949 949
ms950 950
sjis 932
tis620 874
To enable encryption support between the Siebel Server and a component built
using the Java Data Bean
1 Enable encryption in the corresponding Object Manager Server Component. Please refer to Siebel
System Administration Guide for details on how to enable encryption within an Object Manager
Server Component.
2 Set the encryption parameter of the connect string in the Java Data Bean to rsa, which enables
encryption support. For example, siebel.tcpip.rsa.none://<gateway>/<enterprise>/
<ObjMgr>
After completing the two previous steps, communications between the Java Data Bean and the
Siebel Server is encrypted.
To support encryption on platforms not supported by the RSA libraries, Oracle supports the Java
Cryptography Extension (JCE) v1.2.1 specification. JCE is designed so that other qualified
cryptography libraries can be used as service providers.
2 Modify the java.security file to specify your provider of choice and make sure that the
necessary provider JAR files are included in the CLASSPATH.
After completing the three previous steps, communications between the Java Data Bean and the
Siebel Server is encrypted.
Login Errors
The Siebel Data Bean may return a login error including the following text:
Siebel Exception thrown invoking login Method. Code--1. Message-Logon request 75 was
abandoned after 2ms connection
OM or OM process down
Network failure
NAT timeout
Locating objects. These are methods that allow the user to locate instances of objects so that
they can be manipulated by other methods.
Accessing business components. These are methods that provide the ability to access and
modify data within Siebel applications.
Navigation. These are methods that provide a way to control the flow of the application as it is
presented to the user by explicitly setting the focus of the application to the desired view, applet,
or control. These methods are useful only when accessing the Siebel object interfaces from Siebel
VB and when accessing Siebel as a Mobile Web Client Automation Server. When Siebel is accessed
through the COM Data Control, COM Data Server, or Java Data Bean, no Siebel user interface is
present.
Manipulating controls. These are the methods that get or set the value of a control. These
methods are useful only when accessing controls from Browser Script.
Global state properties and functions. These are methods that get information on the current
state.
User interaction. These are methods that provide user interface elements similar to those in
standard Windows programs.
Related Topics
Locating Objects
Accessing Business Components on page 55
Navigation Methods on page 60
User Interaction Methods on page 60
Global State Properties and Functions on page 60
Locating Objects
This set of methods allows the user to locate instances of objects within Siebel applications so they
can be used by other methods. Active objects are instances of objects that currently have focus. The
active control is the control that currently has the user interface focus. The active applet is the applet
that contains the active control. The active business component is the business component
associated with the active applet. When located, an object can be used or manipulated by Siebel
object interfaces.
Many methods are available to use on business components for getting and setting the values of their
fields. Record operations can be performed programmatically by using business component access
methods.
These operations invoke Siebel VB or Siebel eScript extension routines. For example, if you have
created a Siebel VB or Siebel eScript script that is tied to the NewRecord event on a business
component, the script is processed whenever NewRecord in that business component is processed,
even if the NewRecord method was called by another Siebel VB or Siebel eScript script or was called
from the Siebel object interfaces. Note that events are available only with Siebel VB or Siebel eScript.
Navigating away from the current record by any of the following methods:
BusComp.Associate
BusComp.FirstRecord
BusComp.LastRecord
BusComp.NextRecord
BusComp.PreviousRecord
The first example shows how to invoke methods on an existing business component when an event
is triggered. In this example, the VB script is in the SetFieldValue event of a business component:
End If
TheApplication.TraceOff
End Sub
The next example shows how to instantiate your own BusObject and BusComp. This example uses
the PreSetFieldValue event of the Opportunity BusComp. If the Sales Stage is updated to 07 - Verbal
Agreement, a decision maker must be associated with the opportunity. Otherwise, it is reset to the
previous value. The Contacts for the selected opportunity are searched to see if any vice president
or president is associated with the opportunity.
1 GetBusComp
2 SetViewMode (optional, because if you are using Me or the current object, then the BusComp
may already be in the correct mode)
3 ActivateField
4 ClearToQuery
5 SetSearchSpec or SetSearchExpr
NOTE: It is not necessary to activate fields on which search specs and search expressions are
set.
6 ExecuteQuery
sRowId = GetFieldValue("Id")
iViewMode = GetViewMode
Set oBusObj = TheApplication.ActiveBusObject
Navigation Methods
The navigation methods set the focus for user interaction to the named view. Table 8 identifies the
navigation methods. Cannot be invoked from Browser Script.
NOTE: Properties for Siebel objects such as business component applets and business components
are stored in the repository and cannot be changed at run time using Siebel VB methods.
Method
Method
Method
Method
Related Topics
Inter-Application Variable Methods on page 63
Tracing on page 63
Local Variables
Local variables defined within a Siebel script are the lowest level of variable scoping. These variables
are declared using the Dim statement in Siebel VB or the var statement in Siebel eScript, and their
values are accessible only within the script in which they were defined.
function WebApplet_Load ()
{
var localStr;
}
Sub WebApplet_Load
Dim localStr As String
End Sub
Module Variables
Module variables defined in the (general) (declarations) section of a Siebel object (such as an applet
or business component) are the next level of variable scoping. These variables are available as long
as the object is instantiated and the values are accessible to scripts in the same object or module.
Use Dim statements (for VB) or var statements (for eScript) in the (general) (declarations) section
to declare module variables.
(general) (declarations)
Dim ContactId as String
Global Variables
The global variables exist at the highest level. You must declare these variables in every module that
needs to access their values. Use the Global statement to declare these variables. Avoid using global
variables to store Siebel objects such as BusComp and BusObject. If you need to store Siebel objects
such as BusComp and BusObject, always set these variables to Nothing whenever the objects are no
longer required, or at least in the Application_Close event. Failure to do so may cause memory
problems because the objects being referenced cannot be freed from memory while they are still
being referenced. If you must create a global variable for a business component, make sure there is
a global variable for the business object. Otherwise, the business component is out of scope.
Method
Tracing
Table 12 lists Application event methods for controlling debug tracing.
Method
The following topics cover the object interface events and extension events:
ObjectReference is the variable name of the object on which the event is invoked.
The events exposed can be classified into preoperation events or postoperation events. The
preoperation events occur before the standard Siebel operation. An example of a preoperation event
is PreDeleteRecord. This event occurs before a DeleteRecord event occurs.
The corresponding postoperation event is DeleteRecord. This event is fired after the PreDeleteRecord
operation has been executed.
You can use preoperation events to alter standard Siebel behavior. For example, the PreDeleteRecord
event can be used to perform additional, customer-specific validation on the record about to be
deleted, and if the validations fail, the DeleteRecord operation can be canceled.
Postoperation events are useful when the event relies on data that may have been updated in the
course of executing the standard Siebel event.
As Figure 7 illustrates, you can change the outcome of an event by specifying the return value on the
preoperation events. The standard return value for preoperation events is ContinueOperation, which
tells the calling Siebel object to continue processing the remaining operations associated with the
event, as shown in Step 2 in Figure 7.
If you wish to create an alternative to an existing routine, change the return value in your custom
event handler to CancelOperation. This tells the Siebel application to cancel the remaining operations
associated with the event. If, for example, the validation in the PreDeleteRecord event fails, set the
return value for the event to CancelOperation. If you want to preprocess before the default event
method executes, use the return value ContinueOperation.
The post-event handler is rarely scripted, but you may use it for such post-operation events as
posting a notice to a log when the event completes successfully.
The following eScript example sets up a validation routine in which a specific field is queried to
determine whether the event should fire:
The following Siebel VB example sets up a validation routine in which a specific field is queried to
determine whether the event should fire:
If (condition is true)
[perform custom routine]
[cancel operation by raising error text]
Else
returnValue = ContinueOperation
End If
Within this structure, the custom routine is executed only if the condition is true. If the condition is
true, the custom routine substitutes for the built-in routine. If it is not true, the built-in routine is
executed because the event handler returns ContinueOperation.
returnValue = ContinueOperation
If (condition is true)
[perform custom routine]
End If
Note that in PreInvokeMethod events, the condition should always be a test for the method name;
for example:
if (methodName = "PushOpportunity")
If more than one method may be invoked, you may find it more efficient to use a Select structure
(in VB) or a switch structure (in eScript). The following example is in Siebel VB:
var iReturn;
switch (methodName)
{
case "PushOpportunity":
//[custom routine]
iReturn = CancelOperation;
break;
case "Stage3":
//[custom routine]
iReturn = CancelOperation;
break;
default:
iReturn = ContinueOperation;
}
return (iReturn);
To make your code easier to read and maintain, you can create the custom routines as subprograms
or functions in the (general) (declarations) section.
Unique Names
Make sure that every function you create has a unique name. If two functions on the same view have
the same name, results are unpredictable. Good coding practice is to make sure all such names are
unique. Consider using a naming convention, such as using the view name as a function name prefix.
When the preceding code has been placed on the Application_Start event, place a line of code of the
following form in each event handler (including the Pre-event handlers) for the object, including
insert, delete, write, business component, and any others that may apply.
Then perform some simple inserts, updates, and deletes, and make a note of each message as it
appears. You then have a list of the order in which events fire on that view or for that object.
The only means of trapping modifications to a multi-value field is through the underlying MVG
business component. If the multi-value field is modified without popping up the MVG applet, then
the PreSetFieldValue and SetFieldValue events for those fields are not triggered. The only way in
which the PreSetFieldValue and SetFieldValue events are fired for a multi-value field is if the field is
updated within the MVG applet. If the user makes a change to the multi-value field through the MVG
applet, then only the events on the MVG business component are called. No events on the parent
business component are called.
Method
Method
Applet Events
Events are invoked in response to user interactions. These can be managed on a per-applet basis.
Applet events are only supported in high interactivity mode. Table 15 and Table 16 list the User
interface events.
Method
Method
Application Events
Application events are listed in Table 17 and Table 18.
Method
Method
Connect String
The connect string is a URL containing the information needed to connect to any Siebel Server
component. It specifies both the protocol and the details of the Client Application Manager service
in the Siebel Servers to which the client connects. The generic form of the syntax for the connect
string follows:
host="siebel[.transport][.encryption][.compression]://host[:port]/
EnterpriseServer/AppObjMgr_lang" lang=lang_code
SiebelApplication.Login "host=""siebel://host/EnterpriseServer/SCCObjMgr_enu""
lang=ENU, "CCONWAY", "CCONWAY"
Note that the entire protocol string is optional. You can specify the transport protocol alone and
separate it from siebel with a single period:
siebel.tcpip://host/siebel/AppObjMgr_lang
However, if you specify any of the other protocols, you must use a period as a placeholder for each
protocol not specified. The following is an example:
siebel...zlib://hhost/siebel/SCCObjMgr_enu
Protocols that are not specified receive their default values, as shown in Table 19 on page 72.
In Place Of Insert
none (default)
none
host The name of the computer on which the Siebel Server is installed
port The SCBroker port; by default 2321. This changes only if the Siebel
administrator changes the default during installation.
AppObjMgr The name of the defined Application Object Manager that you want the
Web client to access; this can be a user-defined component or one of
these predefined components:
ISSObjMgr_<lang>
SCCObjMgr_<lang>
SSEObjMgr_<lang>
SSVObjMgr_<lang>
For more information about the Login method, see Login Method on page 145.
The following is a sample connect string for the COM Data Control operating in Server Mode:
The following is a sample connect string for the COM Data Control operating in Local Mode. When
running in Local Mode, the COM Data Control must reside on the same machine as the Mobile Web
Client.
The following is a sample connect string for the COM Data Control for PowerBuilder. Char(34) denotes
a double quote:
If you are using a single sign-on (SSO) with Java Data Bean, you must use the login ID of an
employee as the username and the value of the trust token (the TrustToken parameter in the
applications CFG file) in the connect string to log into the server.
m_dataBean.login("Siebel://gatewayserver:2321/enterpriseServer/SCCObjMgr_enu",
SADMIN, HELLO,"enu");
where SADMIN is an employee and TrustToken = HELLO in the [LDAPSecAdpt] section of uagent.cfg.
Connect strings that use Siebel native load balancing have the following structures:
host="siebel://VirtualHost/EnterpriseServer/AppObjMgr_lang"vhosts="<path to
lbconfig.txt>"
For information on lbconfig.txt definition of virtual hosts, see Siebel System Administration
Guide.
host="siebel://VirtualHost/EnterpriseServer/AppObjMgr_lang"
When using generated code, by default, virtual host definitions are read from the
siebel.conmgr.virtualhosts property in the siebel.properties file. The siebel.properties file must
be in the classpath of the Java Virtual Machine.
For information on definition of virtual hosts in siebel.properties, see Transports and Interfaces:
Siebel Enterprise Application Integration.
The following is a sample connect string for the COM Data Control operating in Server Mode in an
environment that implements Siebel round-robin load balancing across Siebel Servers:
where VirtualServer1 matches the VirtualServer parameter in the session manager rules in
lbconfig.txt, for example:
VirtualServer1=1:SiebServA:2321;2:SiebServB:2321;
For information on the structure of the lbconfig.txt file, see Siebel System Administration Guide.
Error Handling
This section explains the Siebel COM Interfaces error handling differences.
Error Handling ExampleCOM Data Control and Mobile Web Client Automation Server
GetBusObject (BusObjectName as string) -> businessObject
Errors in the Siebel Java Data Bean are handled by the SiebelException object. It supports the
getErrorCode() and getErrorMessage() methods. The SiebelException object is defined in
com.siebel.data.SiebelException. It is used as follows:
...
import com.siebel.data.SiebelException;
import com.siebel.data.SiebelDataBean;
...
SiebelDataBean mySiebelBean=null;
try
{
mySiebelBean = new SiebelDataBean();
mySiebelBean.login("Siebel://SOMSERVER/somsiebel/AppObjMgr/, "CCONWAY",
"CCONWAY","enu");
}
catch (SiebelException e){
// Exception handling code
System.out.println (e.getErrorMessage ());
mySiebelBean = null; //avoid using mySiebelBean if login is unsuccessful
}
...
For additional methods on the SiebelException object, refer to the Siebel Java Data Bean JavaDoc
installed with Siebel Tools. Note that the JavaDoc is installed only if the Siebel Java Integration
option is installed. If so, then a zipped file containing the JavaDoc is in the <tools install>\CLASSES
folder.
EnableExceptions
GetLastErrCode
GetLastErrText
EnableExceptions Method
EnableExceptions(enable as integer)
The EnableExceptions method allows applications to use the native COM error-handling technique.
If the method is about to fail due to error, then a COM exception is generated and the method does
not return. The COM host receives the control instead. However, it may display the error message
(this is default for Microsoft Internet Explorer or VB), but it can be changed by scripting.
4 Interfaces Reference
This chapter lists the methods and events available to Siebel object interfaces:
Applet Methods
Table 20 lists the applet methods.
ActiveMode X
Method
BusComp Method X X
BusObject X X
Method
FindActiveXContr X
ol Method
FindControl X
Method
InvokeMethod X X
Method
Name Method X X
Application Methods
Table 21 lists the application methods.
ActiveApplet X
Method
ActiveBusComp X
Method
ActiveBusObject X X X
Method
ActiveViewName X X X
Method
Attach Method X X
CurrencyCode X X X X X X
Method
Detach Method X X
EnableExceptions X X
Method
FindApplet X
Method
GetBusObject X X X X X
Method
GetDataSource X X X X
Method
Called only with
InvokeMethod
GetLastErrCode X X X
Method
GetLastErrText X X X X
Method
GetProfileAttr X X X X X X
Method
GetService X X X X X X X
Method
GetSharedGlobal X X X X X
Method
GotoView Method X
InvokeMethod X X X X X X
Method
IsViewReadOnly X X X X X X
Method
Called only with
InvokeMethod
Language Method X
Called only with
InvokeMethod
LoadObjects X
Method
LoadUserAttribut X
es Method
Login Method X X X X
LoginId Method X X X X X
LoginName X X X X X
Method
Logoff Method X X X
LookupMessage X
Method
LookupValue X X X X
Method
Called only with
InvokeMethod
Name Method X X
NewPropertySet X X X X X X X
Method
PositionId Method X X X X X
PositionName X X X X X
Method
RaiseError X
Method
RaiseErrorText X
Method
SetPositionId X X X X X
Method
SetPositionName X X X X X
Method
SetProfileAttr X X X X X X
Method
SetSharedGlobal X X X X X
Method
ShowModalDialo X
g Method
SWEAlert Method X
Trace Method X X X X X
TraceOff Method X X X X X
TraceOn Method X X X X X
ActivateField X X X X X
Method
ActivateMultipleFie X X X X X
lds Method
Associate Method X X X X X
BusObject Method X X X X X X
ClearLOVCache X X X X X X
Method
Called only with
InvokeMethod
ClearToQuery X X X X X
Method
CreateFile Method X X X X X
Called only with
InvokeMethod
DeactivateFields X X X X X
Method
DeleteRecord X X X X X
Method
ExecuteQuery X X X X X
Method
ExecuteQuery2 X X X X X
Method
FirstRecord Method X X X X X
FirstSelected X
Method
GenerateProposal X X X X X
Method
Called only with
InvokeMethod
GetAssocBusComp X X X X X
Method
GetFieldValue X X X X X X
Method
GetFile Method X X X X X
Called only with
InvokeMethod
GetFormattedField X X X X X X
Value Method
GetLastErrCode X X
Method
GetLastErrText X X
Method
GetMultipleFieldVal X X X X X
ues Method
GetMVGBusComp X X X X X
Method
GetNamedSearch X X X X X
Method
GetPicklistBusCom X X X X X
p Method
GetSearchExpr X X X X X X
Method
GetSearchSpec X X X X X X
Method
GetSortSpec X X X X X
Method
GetUserProperty X X X X X
Method
GetViewMode X X X X X
Method
InvokeMethod X X X X X
Method
LastRecord Method X X X X X
Name Method X X X X X X
NewRecord Method X X X X X
NextRecord X X X X X
Method
NextSelected X
Method
ParentBusComp X X X X X
Method
Pick Method X X X X X
PreviousRecord X X X X X
Method
PutFile Method X X X X X
Called only with
InvokeMethod
RefineQuery X X X X X
Method
RefreshBusComp X X X X X X
Method
Called only with
InvokeMethod
RefreshRecord X X X X X
Method
Called only with
InvokeMethod
Release Method X
SetAdminMode X X X X X
Method
Called only with
InvokeMethod
SetFieldValue X X X X X X
Method
SetFormattedField X X X X X X
Value Method
SetMultipleFieldVal X X X X X
ues Method
SetNamedSearch X X X X X
Method
SetSearchExpr X X X X X
Method
SetSearchSpec X X X X X
Method
SetSortSpec X X X X X
Method
SetUserProperty X X X X X
Method
SetViewMode X X X X X
Method
UndoRecord X X X X X
Method
WriteRecord X X X X X X
Method
GetBusComp X X X X X X
Method
GetLastErrCode X X
Method
GetLastErrText X X
Method
Name Method X X X X X X
Release Method X
GetFirstProperty X X X X X X
Method
GetNextProperty X X X X X X
Method
GetProperty X X X X X X
Method
InvokeMethod X X X X X X X
Method
Name Method X X X X X X X
PropertyExists X X X X X X
Method
Release Method X
RemoveProperty X X X X X X
Method
SetProperty X X X X X X
Method
Control Methods
Table 25 lists the control methods.
Applet Method X
BusComp Method X
GetProperty X
Method
GetValue Method X
Name Method X
SetLabelProperty X
Method
SetProperty X
Method
SetValue Method X
AddChild Method X X X X X X X
Copy Method X X X X X X X
GetByteValue X
Method
GetChild Method X X X X X X X
GetChildCount X X X X X X X
Method
GetFirstProperty X X X X X X X
Method
GetLastErrCode X
Method
GetLastErrText X
Method
GetNextProperty X X X X X X X
Method
GetProperty X X X X X X X
Method
GetPropertyCount X X X X X X X
Method
GetType Method X X X X X X X
GetValue Method X X X X X X X
InsertChildAt X X X X X X X
Method
PropertyExists X X X X X X X
Method
RemoveChild X X X X X X X
Method
RemoveProperty X X X X X X X
Method
Reset Method X X X X X X X
SetByteValue X
Method
SetProperty X X X X X X X
Method
SetType Method X X X X X X X
SetValue Method X X X X X X X
ToString Method X
Miscellaneous Methods
Table 27 lists miscellaneous methods.
GetErrorCode X
Method
GetErrorMessage X
Method
TheApplication X X
Method
Applet Events
Applet Events
Table 28 lists the applet events.
Server Browser
Event Script Script Comments
Applet_ChangeFieldValue Event X
Applet_ChangeRecord Event X
Applet_InvokeMethod Event X
Applet_Load Event X
Applet_PreInvokeMethod Event X
WebApplet_InvokeMethod Event X
WebApplet_Load Event X
WebApplet_PreCanInvokeMethod Event X
WebApplet_PreInvokeMethod Event X
Application Events
Table 29 lists the application events.
Application_Close Event X
Application_InvokeMethod Event X X
Application_Navigate Event X
Application_PreInvokeMethod Event X X
Application_PreNavigate Event X
Application_Start Event X
Server Browser
Event Script Script Comments
BusComp_Associate Event X
BusComp_ChangeRecord Event X
BusComp_CopyRecord Event X
BusComp_DeleteRecord Event X
BusComp_InvokeMethod Event X
BusComp_NewRecord Event X
BusComp_PreAssociate Event X
BusComp_PreCopyRecord Event X
BusComp_PreDeleteRecord Event X
BusComp_PreGetFieldValue Event X
BusComp_PreInvokeMethod Event X
BusComp_PreNewRecord Event X
BusComp_PreQuery Event X
Server Browser
Event Script Script Comments
BusComp_PreWriteRecord Event X
BusComp_Query Event X
BusComp_SetFieldValue Event X
BusComp_WriteRecord Event X
Server Browser
Event Script Script Comments
Service_InvokeMethod Event X X
Service_PreCanInvokeMethod Event X X
Service_PreInvokeMethod Event X X
Siebel Constants
The Siebel programming languages provide constants for the convenience of programmers. These
constants are listed in Table 32. Use the constant names, rather than their integer values in your
code. Use of these constant names makes your code more readable by others, because it clarifies
your intentions. The integer values are included only to aid in debugging. A constants integer value
appears in the Debugger when the constant is stored in a local variable and the value of the local
variable is exposed.
CancelOperation 2
ForwardOnly 257
NewAfter 1
NewBeforeCopy 2
(Not available with Java Data Bean)
NewAfterCopy 3
(Not available with Java Data Bean)
ManagerView 1
PersonalView 2
AllView 3
OrganizationView 5
GroupView 7
CatalogView 8
SubOrganizationView 9
Applet Methods
In the following methods, the placeholder Applet in the syntax represents an applet instance:
ActiveMode Method
ActiveMode Method
ActiveMode returns a string containing the name of the current Web Template mode.
Syntax
Applet.ActiveMode
Argument Description
Not applicable
Returns
A string containing the name of the current Web Template mode.
Used With
Browser Script
Example
The following example is in Browser Script:
function Applet_Load ()
{
var currMode = this.ActiveMode();
alert("The active mode for the selected applet is: " + currMode);
}
BusComp Method
BusComp returns the business component that is associated with the applet.
Syntax
Applet.BusComp();
Argument Description
Not applicable
Returns
The business component associated with the applet.
Used With
Browser Script, Server Script
BusObject Method
BusObject returns the business object for the business component of the applet.
Syntax
Applet.BusObject()
Argument Description
Not applicable
Returns
The business object for the applets business component.
Used With
Browser Script, Server Script
Example
The following example is in Browser Script:
function Applet_Load ()
{
var appletname = this.Name();
var currBO = this.BusObject();
var currBOName = currBO.Name();
alert("The active Business Object for the " + appletname + " is: " + currBOName);
}
function WebApplet_Load ()
{
var busObj = this.BusObject();
}
Sub WebApplet_Load
Dim oBusObject As BusObject
Set oBusObject = Me.BusObject
End Sub
FindActiveXControl Method
FindActiveXControl returns a reference to a DOM element based upon the name specified in the name
argument.
Syntax
Applet.FindActiveXControl(controlName)
Argument Description
controlName Literal string or string variable containing the name of the desired control
Returns
The control object identified in controlName.
Usage
FindActiveXControl is used for finding controls on form applets. It does not locate list columns on list
applets.
Used With
Browser Script
Example
The following Browser Script example interacts with a Microsoft slide ActiveX control that has been
placed on a Siebel applet:
FindControl Method
FindControl returns the control whose name is specified in the argument. This applet must be part
of the displayed view.
Syntax
Applet.FindControl(controlName)
Argument Description
controlName Literal string or string variable containing the name of the desired control
Returns
The control object identified in controlName.
Usage
FindControl does not find controls for MVG applets, Pick applets, Associate applets, or detail applets
that are not on the views applet list. It also does not locate list columns on list applets.
Used With
Browser Script
Example
To use this Browser Script example, read the notes for the SetLabelProperty Method on page 291.
InvokeMethod Method
The InvokeMethod method invokes the specialized or custom method specified by its argument.
Argument Description
Argument Description
Returns
In Server Script, returns a string containing the result of the method.
Usage
Available to Browser and Server scripting. If the method to be invoked exists in the Browser, it
executes in the browser. Otherwise, the request is sent to the server for execution.
NOTE: The InvokeMethod method should only be used with documented methods. Oracle does not
support calling methods with InvokeMethod, unless they are listed in this book. Calling InvokeMethod
with an undocumented method is not supported. Undocumented methods may be modified or
obsoleted without notice. Use of undocumented methods is entirely at your own risk.
Used With
Browser Script, Server Script
Example
The following example is in Siebel eScript:
}
return(iReturn);
}
Name Method
The Name method returns the name of the applet.
Syntax
Applet.Name()
Argument Description
Not applicable
Returns
A string containing the applet object name.
Used With
Browser Script, Server Script
Example
The following example is in Browser Script:
function Applet_Load ()
{
//Display the name of the applet when the applet loads using the
//applet.Name() method to obtain the name of the applet
var appletName;
appletName = this.Name();
alert("The name of the applet is: " + appletName);
}
function WebApplet_Load ()
{
//Display the name of the applet when the applet loads using the
//applet.Name() method to obtain the name of the applet
var appletName;
appletName = this.Name();
TheApplication().RaiseErrorText("The name of the applet is: " + appletName);
}
Sub WebApplet_Load
' Display the name of the applet when the applet loads using the
' applet.Name() method to obtain the name of the applet
Dim appletName As String
appletName = Me.Name
TheApplication.RaiseErrorText "The name of the applet is: " & appletName
End Sub
Applet Events
The following topics describe applet events:
Applet_ChangeFieldValue Event
The ChangeFieldValue event fires after the data in a field changes through the applet in the user
interface.
Syntax
Applet_ChangefieldValue(fieldname, fieldValue)
Argument Description
FieldName A string representing the name of the field whose value changed
Returns
Not applicable
Usage
ChangeFieldValue fires after the data in a field changes, but not when a user moves to a different
record without changing a value in the previous record. If a user changes the value in a field, and
other dependent fields, such as calculated fields, change as a result, the event fires once for each
field whose value changed.
NOTE: This event does not trigger for changes made in pick applets or popup applets.
Used With
Browser Script
Example
The following example is in Browser Script:
Related Topic
Applet_ChangeRecord Event
Applet_ChangeRecord Event
The ChangeRecord event is called when the user moves to a different row or view.
Syntax
Applet_ChangeRecord()
Argument Description
Not applicable
Returns
Not applicable
Used With
Browser Script
Example
The following example is in Browser Script:
function Applet_ChangeRecord ()
{
try
{
var thisBC = this.BusComp();
var sFlag = thisBC.GetFieldValue("Primary Revenue Committed Flag");
if (sFlag == "Y")
{
alert("This record cannot be update as its been Committed");
}
}
catch(e)
{
alert("Error in ChangeFieldValue and error is " + e.toString() + " " +
e.errText());
}
}
Related Topic
Applet_ChangeFieldValue Event on page 99
Applet_InvokeMethod Event
The InvokeMethod event is triggered by a call to applet.InvokeMethod or a specialized method, or
by a user-defined menu.
Syntax
Applet_InvokeMethod(name, inputPropSet)
Argument Description
Returns
Not applicable
Usage
Typical uses include showing or hiding controls, or setting a search specification. When accessing a
business component from this event handler, use this.BusComp(), rather than
TheApplication.ActiveBusComp.
Used With
Browser Script
Example
Some special methods create, modify, or delete records. In some cases, events at the applet or
business component level are triggered by these actions. If there is a requirement to perform a
specific action before and after the method has been executed, these events can be used. In this
example, code has been added to the PreInvokeMethod and InvokeMethod applet events to set and
reset the flag and to the NewRecord server event to set the fields.
return ("ContinueOperation");
}
function BusComp_NewRecord ()
{
if (TheApplication().GetProfileAttr("flag")== "1" )
{
this.SetFieldValue ("Field1", "Value1");
this.SetFieldValue ("Field2", "Value2");
. . . . .
}
Related Topics
Applet_PreInvokeMethod Event on page 104
Application_InvokeMethod Event on page 172
Applet_Load Event
The Applet_Load event is triggered after an applet has loaded and after data is displayed.
Syntax
Applet_Load()
Argument Description
Not applicable
Returns
Not applicable
Usage
You can use this event with form applets to dynamically hide or manipulate controls or set properties
on an ActiveX Control. The following controls can be dynamically modified: CheckBox, ComboBox,
TextBox, TextArea, Label.
NOTE: Do not use the SWEAlert or RaiseErrorText methods in this event to display a popup. This can
cause the browser to crash if the application has not yet been fully rendered in the browser.
Used With
Browser Script
Example
Use this event to dynamically hide or manipulate controls or set properties on a control. The following
controls can be dynamically modified: CheckBox, ComboBox, Label, TextArea, and TextBox.
function Applet_Load ()
{
// Get the control instance.
var ctrl = this.FindControl("FirstName");
Applet_PreInvokeMethod Event
The PreInvokeMethod event is called before a specialized method is invoked, by a user-defined applet
menu, or by calling InvokeMethod on an applet.
Syntax
Applet_PreInvokeMethod(Name, inputPropSet)
Argument Description
inputPropSet A property set containing arguments to be passed to the PreInvokeMethod
event
Returns
ContinueOperation or CancelOperation
Usage
The PreInvokeMethod event is called just before a specialized method is invoked on the applet. If
implementing a new method (not defined by the built-in functions), the Basic script should return
CancelOperation to avoid invoking an Unknown Method Name error. Specialized methods are
methods based on applet or business component classes other than CSSFrame and CSSBusComp,
respectivelythat is, specialized classes.
CancelOperation does not stop the execution of the code following it, but it does prevent the
execution of any built-in code associated with this event. Applet_PreInvokeMethod should return
CancelOperation when you are handling the event entirely through scripting and do not want the
built-in code to execute. However, if there is code in the same script following CancelOperation, that
code runs regardless of the CancelOperation.
Used With
Browser Script
Example
function Applet_PreInvokeMethod (name, inputPropSet)
{
if(name == 'NewRecord')
{
if(confirm("Are you sure you want to create a new record?"))
return ("ContinueOperation");
else
return ("CancelOperation");
return ("ContinueOperation");
}
}
Related Topic
How Your Script Affects Program Flow on page 64
WebApplet_InvokeMethod Event
The InvokeMethod event is called after a specialized method on the Web applet has been executed.
WebApplet_InvokeMethod triggers for Siebel-defined methods only, it does not trigger for user-
defined methods.
Syntax
WebApplet_InvokeMethod(methodName)
Argument Description
methodName String variable or literal containing the name of the method invoked.
Returns
Not applicable
Used With
Server Script
Example
The following example is in Siebel eScript:
switch (MethodName)
{
case "NewQuery":
TheApplication().SetSharedGlobal("EnableButton", "N"); break;
case "ExecuteQuery":
TheApplication().SetSharedGlobal("EnableButton", ""); break;
case "UndoQuery":
TheApplication().SetSharedGlobal("EnableButton", "");
break;
}
Related Topics
Applet_InvokeMethod Event on page 101
Application_InvokeMethod Event on page 172
WebApplet_PreCanInvokeMethod Event on page 108
WebApplet_Load Event
The Load event is triggered just after an applet is loaded.
Syntax
WebApplet_Load()
Argument Description
Not applicable
Returns
Not applicable
Usage
Do not call TheApplication().ActiveBusObject from WebApplet_Load because it returns a null. Instead
use this.BusObject() to obtain a reference to the current business object.
Used With
Server Script
Example
The following example is in Siebel eScript:
function WebApplet_Load ()
{
try
{
var currBC = this.BusComp();
with (currBC)
{
SetViewMode(OrganizationView);
ClearToQuery();
SetSearchSpec("Last Name", "A*");
ExecuteQuery(ForwardBackward);
}
}
catch (e)
{
TheApplication().RaiseErrorText(e.errText);
}
}
Sub WebApplet_Load
Dim iReturn As Integer
Dim currBC As BusComp
Set currBC = Me.BusComp
With currBC
.SetViewMode OrganizationView
.ClearToQuery
.SetSearchSpec "Last Name", "A*"
.ExecuteQuery
End With
End Sub
Related Topics
Applet_InvokeMethod Event on page 101
Application_InvokeMethod Event on page 172
WebApplet_PreCanInvokeMethod Event on page 108
WebApplet_PreCanInvokeMethod Event
The PreCanInvokeMethod event is called under the following conditions, allowing the script to
determine whether or not the user has the authority to invoke the applet method:
NOTE: It is often easier to enable and disable methods at the applet level declaratively, using the
CanInvokeMethod applet user property. For an example of this, see Invoking Custom Methods with
MiniButton Controls on page 425. For more information on the CanInvokeMethod user property, see
Siebel Developers Reference.
Syntax
WebApplet_PreCanInvokeMethod(MethodName, &CanInvoke)
Argument Description
&CanInvoke A string representing whether or not the Applet method can be invoked. Valid
values are TRUE or FALSE.
NOTE: Using the FirstSelected business component method with the PreCanInvokeMethod event can
cause unexpected behavior in pick applets invoked from the applet where this event is called.
Returns
CancelOperation or ContinueOperation
Used With
Server Script
Example
The following example is in Siebel eScript:
}
return (ContinueOperation);
}
WebApplet_PreInvokeMethod Event
The PreInvokeMethod event is called before a specialized method for the Web applet is invoked or a
user-defined method is invoked through oWebApplet.InvokeMethod.
Syntax
WebApplet_PreInvokeMethod(methodName)
Argument Description
methodName String variable or literal containing the name of the method invoked
Returns
ContinueOperation or CancelOperation
Usage
The PreInvokeMethod event is called just before a specialized method is invoked on the Web applet.
If implementing a new method (not defined by the built-in functions), the script should return
CancelOperation to avoid invoking an Unknown Method Name error.
CancelOperation does not stop the execution of the code following it, but it does prevent the
execution of any built-in code associated with this event. WebApplet_PreInvokeMethod should return
CancelOperation when you are handling the event entirely through scripting and you do not want the
built-in code to execute. However, if there is code in the same script following CancelOperation, that
code runs regardless of the CancelOperation.
Used With
Server Script
Example
The following example is in Siebel eScript:
WebApplet_ShowControl Event
This event allows scripts to modify the HTML generated by the Siebel Web Engine to render a control
on a Web page in an application running in standard interactivity mode.
Syntax
WebApplet_ShowControl (controlName, property, mode, HTML)
Argument Description
property A string indicating the value of the property attribute of the swe:control or
swe:this tag that triggers this event; it can also be an empty string if this
attribute is not specified for the tag.
mode The mode of the applet that is being shown; possible modes are:
Base
Edit
New
Query
Sort
HTML The HTML generated by the Siebel Web Engine for the swe:control or
swe:this tag that triggers this event.
Returns
Not applicable
Usage
The generated HTML depends on the control, the property being shown, and the mode of the applet.
The script can modify the value of the HTML argument, and the Siebel Web Engine sends the modified
value back to the Web browser.
Customer applications render the layout of applets using template files (.swt files). These are HTML
files that contain special placeholder tags that indicate where a control is to be rendered. These
control placeholder tags (<swe:control>) can be included in the following two ways:
The <swe:control> tag and <swe:this> tag are used to show a control:
<swe:control id="1">
.
.
.
<swe:this property="DisplayName"/>
.
.
.
</swe:control>
In the first instance, if the control ID is mapped to an actual control in the applet using Siebel Tools,
Siebel Web Engine renders the DisplayName property of the control at the point where this tag is
placed in the template file.
In the second instance, the Siebel Web Engine renders the DisplayName property of the control at
the point where the <swe:this> tag is placed in the template file. The outer <swe:control> tag in
this case is used only to check if the control ID is mapped to an actual control in the applet.
The Siebel Web Engine converts these tags into HTML to render the controls on the Web page. The
WebApplet_ShowControl event is triggered for each of these tags after the Siebel Web Engine has
generated the HTML for rendering the control, but before the generated HTML is sent back to the
browser. This gives the scripts a chance to modify the generated HTML before it is shown.
In the first example, the event fires only once, after the Siebel Web Engine generates the HTML for
the <swe:control> tag. In the second example, this event gets fired twice. The event is first fired
when the Siebel Web Engine has generated the HTML for the <swe:this> tag. The event is fired
again when the Siebel Web Engine has generated the HTML for the outer <swe:control> tag; that
is, after everything between the <swe:control> and </swe:control> tags, including the <swe:this>
tag, is converted into HTML. The script can distinguish between these two event calls by the value
of the property attribute of the tag that is passed as an argument to the event.
Used With
Server Script
Example
This Siebel eScript script displays negative amounts in red in a read-only form:
WebApplet_ShowListColumn Event
This event allows scripts to modify the HTML generated by the Siebel Web Engine to render a list
column on a Web page in an application running in standard interactivity mode.
Syntax
WebApplet_ShowListColumn (columnName, property, mode, HTML)
Argument Description
property A string indicating the value of the property attribute of the swe:control or
swe:this tag that triggers this event; it can also be a empty string if this
attribute is not specified for the tag.
mode The mode of the applet that is being shown; possible modes are:
Base
Edit
New
Query
Sort
HTML The HTML generated by the Siebel Web Engine for the swe:control or swe:this
tag that triggers this event
Returns
Not applicable
Usage
The generated HTML depends on the list column, the property being shown, and the mode of the
applet. The script can modify the value of the HTML argument, and the Siebel Web Engine sends the
modified value back to the Web browser.
Customer applications render the layout of applets using template files (.swt files). These are HTML
files that contain special placeholder tags that indicate where a control is to be rendered. These
control placeholder tags (<swe:control>) can be included in the following two ways:
The <swe:control> tag and <swe:this> tag are used to show a list column:
<swe:control id="1">
.
.
.
<swe:this property="DisplayName"/>
.
.
.
</swe:control>
In the first instance, if the list column ID is mapped to a list column in the applet using Siebel Tools,
Siebel Web Engine renders the DisplayName property of the list column at the point where this tag
is placed in the template file.
In the second instance, the Siebel Web Engine renders the DisplayName property of the list column
at the point where the <swe:this> tag is placed in the template file. The outer <swe:control> tag
in this case is used only to check if the list column ID is mapped to an actual list column in the applet.
The Siebel Web Engine converts these tags into HTML to render the list columns on the Web page.
The WebApplet_ShowListColumn event is triggered for each of these tags after the Siebel Web Engine
has generated the HTML for rendering the list column, but before the generated HTML is sent back
to the browser. This gives the scripts a chance to modify the generated HTML before it is shown.
In the first example, the event fires only once, after the HTML for the <swe:control> tag is generated
by the Siebel Web Engine. In the second example, this event is triggered twice. The event is first
triggered when the Siebel Web Engine has generated the HTML for the <swe:this> tag. The event
is fired again when the Siebel Web Engine has generated the HTML for the outer <swe:control> tag;
that is, after everything between the <swe:control> and </swe:control> tags, including the
<swe:this> tag, is converted into HTML. The script can distinguish between these two event calls by
the value of the property attribute of the tag that is passed as an argument to the event.
Used With
Server Script
Example
This Siebel VB script displays negative amounts in a list in red:
Application Methods
The following methods are built-in methods that return the current Siebel Application object
instance:
TheApplication() (case-sensitive) when called from Siebel eScript within Siebel Tools
theApplication() (case-sensitive) when called from Browser Script within Siebel Tools
If an Application method applies to one scripting language, then the Syntax definition in the methods
section includes TheApplication, TheApplication(), or theApplication() specifically.
If a method applies to external interfaces or to more than one scripting language, and thus to more
than one syntax, then the Syntax definition includes Application, which denotes that:
The applicable construct should be substituted for Application in Siebel VB, Siebel eScript, or
Browser Script
The name of an Application instance should be substituted for Application when you use external
interfaces.
ActiveApplet Method
ActiveApplet returns a reference to the applet that currently has focus.
Syntax
theApplication().ActiveApplet();
Argument Description
Not applicable
Returns
The name of the applet instance that has focus
Usage
Use this method to determine which applet currently has focus. The applet typically has a blue border
to show that it is active.
Used With
Browser Script
Example
function Applet_PreInvokeMethod (name, inputPropSet)
{
switch (name)
{
case "Drilldown":
var activeapplet = theApplication().ActiveApplet();
var activeappletname = activeapplet.Name();
alert("Here is the applet we are drilling down from " + activeappletname);
break;
}
return ("ContinueOperation");
}
ActiveBusComp Method
ActiveBusComp returns the business component associated with the active applet.
Syntax
theApplication().ActiveBusComp();
Argument Description
Not applicable
Returns
The business component associated with the active applet
Used With
Browser Script
Example
function Applet_Load ()
{
var activeBC = theApplication().ActiveBusComp();
activeBC = activeBC.Name();
alert(activeBC);
}
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.
if (oBO.Name() == "Contact")
{
var oBC = oBO.GetBusComp("Contact");
var sEmail = oBC.GetFieldValue("Email Address");
SendMail(sEmail);
sEmail ="";
}
return (CancelOperation);
}
return (ContinueOperation);
}
SendEmail(sEmail)
sEmail =""
End If
iRtn = CancelOperation
End If
WebApplet_PreInvokeMethod = iRtn
End Function
ActiveViewName Method
ActiveViewName returns the name of the active view.
Syntax
Application.ActiveViewName
Argument Description
Not applicable
Returns
A string containing the active view name
Usage
Do not use the ActiveViewName method in any event handler that may be initiated by the COM Data
Server, COM Data Control, or Java Data Bean.
Used With
Browser Script, Mobile Web Client Automation Server, Server Script
Example
The following example is in Siebel eScript:
Attach Method
The Attach method allows an external application to reconnect to an existing Siebel session.
Syntax
Application.Attach(sessionString)
Argument Description
sessionString A string containing the Siebel Session Id. The sessionString is typically the
output of the Detach method.
Returns
Boolean indicating whether or not the method was successfully executed
Used With
COM Data Control, Java Data Bean
Examples
Each of these examples instantiates the first COM Data Control instance, logs in to a Siebel Server,
detaches this instance, and then gains the session string. It then instantiates the second COM Data
Control instance. It does not need to log in again, as it attaches to the existing session by using the
session string. This reuses the connection created by the first instance.
The following example is for COM Data Control and is written in native Visual Basic:
errCode = SiebelApplication_first.GetLastErrCode
If errCode <> 0 Then
errText = SiebelApplication_first.GetLastErrText
MsgBox errText
Exit Sub
End If
SiebelApplication_second.LogOff
Set SiebelApplication_second = Nothing
Set SiebelApplication_first = Nothing
import com.siebel.data.*;
import com.siebel.data.SiebelException;
public JDBAttachDetachDemo()
{
try
{
// Instantiate the Siebel Data Bean
m_dataBean_first = new SiebelDataBean();
// Do Attach
System.out.println("Attaching in to the Siebel server ");
m_dataBean_second.attach(detachHandle);
System.out.println("Attach Done ");
// Logoff
m_dataBean_second.logoff();
}
catch (SiebelException e)
{
System.out.println(e.getErrorMessage());
}
}
}
CurrencyCode Method
CurrencyCode returns the operating currency code associated with the division to which the users
position has been assigned.
Syntax
Application.CurrencyCode
Argument Description
Not applicable
Returns
A string containing the currency code; for example, USD for U.S. dollars, EUR for the euro, JPY for
the Japanese yen.
Used With
Browser Script, COM Data Control, COM Data Server, Web Client Automation Server, Server Script
Example
The following example is in Siebel eScript:
function WebApplet_Load ()
{
var currencycode;
currencycode = TheApplication().CurrencyCode();
var WshShell = COMCreateObject("WScript.Shell");
WshShell.Popup(currencycode);
}
Detach Method
The Detach method returns a string containing the Siebel session Id.
Syntax
Application.Detach
Argument Description
Not applicable
Returns
String containing the Siebel session Id.
Usage
The string returned by the Detach method should only be used with the Attach method.
Used With
COM Data Control, Java Data Bean
Examples
For a Java Data Bean sample and a native VB sample using COM Data Control, read Attach Method
on page 121.
EnableExceptions Method
The EnableExceptions method enables or disables native COM error handling.
Syntax
Application.EnableExceptions(bEnable)
Argument Description
Returns
Not applicable
Usage
Setting the argument to TRUE enables native error handling. This allows applications to intercept and
display the exception ID and description. Native COM error handling is disabled by default.
Used With
COM Data Control, Mobile Web Client Automation Server
Examples
This native Visual Basic script uses the Siebel ActiveX Data Control to connect to the Siebel
Application and instantiate a business object. The script prompts the user to select whether the
native error handling is to be enabled or not. If yes, the script throws the error immediately when it
gets an error. If not, the script suppresses Siebel errors and errors are only detected by using
GetLastErrCode method.
SiebelApplication_first.Login "host=""Siebel.tcpip.none.none://<virtual
ip>:<port>/<enterprise>/<object manager>""", "<user id>", "<password>"
errCode = SiebelApplication.GetLastErrCode()
If errCode <> 0 Then 'if native error handle is disabled, this block detects it
ErrText = SiebelApplication.GetLastErrText
MsgBox ErrText
Exit Sub
End If
This Visual Basic sample code uses the Siebel Mobile Automation Server to connect to the Siebel
Application and instantiate a business object. The program prompts the user to select whether the
native error handling is to be enabled or not. If yes, the script throws the error immediately when it
gets an error. If not, the script suppresses Siebel errors and errors are only detected by using
GetLastErrCode method.
errCode = SiebelApp.GetLastErrCode()
If errCode <> 0 Then 'if native error handle is disabled, this block detects it
ErrText = SiebelApp.GetLastErrText
MsgBox ErrText
Exit Sub
End If
FindApplet Method
FindApplet returns the applet that is identified by the appletName argument.
Syntax
theApplication().FindApplet(appletName)
Argument Description
appletName String variable or literal containing the name of the desired applet.
Returns
The applet identified in appletName
Usage
The only applets available are applets visible in the active view.
Used With
Browser Script
Example
The following example is in Browser Script:
GetBusObject Method
The GetBusObject method instantiates and returns a new instance of the business object specified
in its argument.
Syntax
Application.GetBusObject(busObjectName)
Argument Description
busObjectName String variable or literal containing the name of the business object to
instantiate.
Returns
The business object instance specified in the argument
Usage
Set the business object to Nothing to destroy the instantiated business object after it is no longer
needed. 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
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Examples
The following examples always instantiate and return a new instance of the business object specified
in the argument, which is the Account business object.
oBusComp = null;
oBusObject = null;
The following examples instantiate and return a new instance of the business object as did the
previous example. However, the difference is that the business object returned could vary depending
on the location from which the code is invoked, such as a Web applet event. This is useful when you
want to refer to the currently active business object.
GetLastErrCode Method
The GetLastErrCode method returns the last error execution status.
Syntax
Application.GetLastErrCode
Argument Description
Not applicable
Returns
A short integer containing the last error execution status: 0 indicates no error.
Usage
After execution of a method, the GetLastErrCode can be invoked to check if any error was returned
from the previous operation. GetLastErrText method can be invoked to retrieve the text of the error
message. Each method invocation resets the execution status.
Used With
COM Data Control, COM Data Server, Mobile Web Client Automation Server, Web Client Automation
Server
Example
The following example is for COM Data Control. SiebelApplication is an Application instance.
errcode = SiebelApplication.GetLastErrCode
If errcode <> 0 Then
ErrText = SiebelApplication.GetLastErrText
MsgBox ErrText
Exit Sub
End If
Related Topic
GetLastErrText Method on page 130
GetLastErrText Method
The GetLastErrText method returns the last error text message.
Syntax
Application.GetLastErrText
Argument Description
Not applicable
Returns
The last error text message as a string
Used With
COM Data Control, COM Data Server, Mobile Web Client Automation Server, Web Client Automation
Server
Example
The following example is for COM Data Control. SiebelApplication is an Application instance.
errcode = SiebelApplication.GetLastErrCode
If errcode <> 0 Then
ErrText = SiebelApplication.GetLastErrText
MsgBox ErrText
Exit Sub
End If
Related Topic
GetLastErrCode Method on page 129
GetProfileAttr Method
GetProfileAttr returns the value of an attribute in a user profile.
Syntax
Application.GetProfileAttr(name)
Argument Description
Returns
The value of the attribute name
Usage
GetProfileAttr is used in personalization to retrieve values of attributes in a user profile. It cannot be
used with system fields, except Id, because they are not explicitly defined in the Personalization
Profile business component. For more information on profile attributes, see Siebel Personalization
Administration Guide.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script
Examples
The following example is in Browser Script:
Related Topic
SetProfileAttr Method on page 158
GetService Method
The GetService method returns a specified business service. If the business service is not already
running, it is constructed.
Syntax
Application.GetService(serviceName)
Argument Description
Returns
A reference to the requested business service
Usage
This method finds the business service indicated by serviceName; it constructs the service if it is not
already running. It first searches through the built-in services that are stored in the repository. If
the business service is not found, GetService searches through services defined in the run-time
Business Services table.
A business service is normally deleted from memory as soon as every reference to it, such as local
or global variables, is cleared by setting it to another value. However, if the Cache flag on the
business service is set, the service remains in memory as long as the Siebel application is running.
To invoke a business service using the Web Client Automation Server and Browser Script, the
business service must first be registered in Siebel Tools as an application user property. This prevents
Service Not Found errors.
2 Select the desired application, for example Siebel Universal Agent, in the Object List Editor.
3 In the Object Explorer, expand the Application object, and then choose Application User Prop.
4 In the Object List Editor, create new application user property records as needed:
Name Value
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script, Web Client Automation Server
Examples
The following examples instantiate a business service named Workflow Process Manager.
GetSharedGlobal Method
Shared global variables are unique to the user and the users associated session. One user's global
variables are not visible to other users. The variables are global to the current user and session only.
The GetSharedGlobal method gets the shared user-defined global variables.
Syntax
Application.GetSharedGlobal(varName)
Argument Description
varName String literal or variable containing the name of the global variable
Returns
A string containing the user-defined global variables.
Usage
GetSharedGlobal("varName")
Used With
COM Data Control, COM Data Server, Mobile Web Client Automation Server, Server Script
Examples
In the following examples, the GetSharedGlobal method is called to get a global variable called
myGlobalVar. The global variable was originally set using the SetSharedGlobal method in the
Application_Start event. The global variable can be accessed from any event. For these examples, in
the BusComp_WriteRecord event, the GetSharedGlobal method is called to retrieve myGlobalVar.
function BusComp_WriteRecord ()
{
var myVar;
myVar = TheApplication().GetSharedGlobal("myGlobalVar");
}
Sub BusComp_WriteRecord
Dim myVar as String
myVar = TheApplication.GetSharedGlobal("myGlobalVar")
End Sub
Related Topic
SetSharedGlobal Method on page 160
GotoView Method
GotoView activates the named view and its BusObject. As a side effect, this method activates the
views primary applet and its BusComp and activates the primary applets 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, Application_Start, Navigate, PreNavigate, and WebApplet_Load.
The following Siebel VB script uses GotoView to programmatically navigate to the Opportunity List
view.
Alternatively, if your application has already instantiated an Opportunity object with the object
reference of objOppty, the appropriate usage in Siebel VB is:
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.
function BusComp_WriteRecord ()
{
var leadQuality;
var actName;
var actBO;
var actBC;
with (actBC)
{
SetViewMode(AllView);
ClearToQuery();
SetSearchSpec("Name", actName);
ExecuteQuery();
}
}
else
{
TheApplication().GotoView("Opportunity Detail - Activities View");
}
actBC = null;
actBO = null;
Sub BusComp_WriteRecord
With actBC
.SetViewMode AllView
.ClearToQuery
.SetSearchSpec "Name", actName
.ExecuteQuery
End With
Else
TheApplication.GotoView "Opportunity Detail - Activities View"
End If
End Sub
InvokeMethod Method
InvokeMethod calls a specialized method or user-defined method specified by its argument.
Argument Description
Argument Description
Returns
In Server Script, returns a string containing the result of the method
Usage
InvokeMethod allows you to call methods on an Application object that is exposed directly through
the Application interface.
NOTE: The InvokeMethod method should be used only with documented specialized methods. Oracle
does not support calling specialized methods with InvokeMethod unless they are listed in this book.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script
Example
For an example, read InvokeMethod Method on page 96.
GetDataSource Method
Returns the name of the data source, as defined in the CFG file, that is being used for the session.
Syntax
dataSrc = Application.InvokeMethod(GetDataSource)
Argument Description
Not applicable
Returns
A string containing the value of the data source currently used by the application.
Used With
This method is supported by Application.InvokeMethod() calls in COM Data Control, Java Data Bean,
Mobile Web Client Automation Server, and Server Script.
Example
The following eScript example detects the data source and displays its name in a dialog box.
IsViewReadOnly Method
You can use the IsViewReadOnly method to test whether a view is read-only.
Syntax
Application.InvokeMethod(IsViewReadOnly,viewName)
Argument Description
Returns
Returns TRUE if the view is read-only, else it returns FALSE. If neither of these values is returned,
then an error has occurred. Your script should provide a handler if neither TRUE nor FALSE is
returned.
Usage
You can set a view as read-only for particular responsibilities in the Responsibility Administration
view. One use of the IsViewReadOnly method is to determine whether such a view is read-only for
the current responsibility before attempting to edit a field.
Buttons are not automatically set to read-only on views that are read-only due to the view-
responsibility association, so another application is to set buttons to read-only in views for which
IsViewReadOnly returns TRUE.
Used With
This method is supported by Application.InvokeMethod() calls in Browser Script, COM Data Control,
COM Data Server, Java Data Bean, Mobile Web Client Automation Server, and Server Script.
Example
The following example is for Siebel eScript:
function BusComp_PreSetFieldValue(FieldName,FieldValue)
else if
else
Language Method
Retrieves the language code of the language in which the active application is running.
Syntax
Application.InvokeMethod(Language);
Argument Description
Not applicable
Returns
The language code of the active application, for example ENU
Used With
This method is supported by Application.InvokeMethod() calls in Server Script.
Example
Siebel VB:
curLang = TheApplication.InvokeMethod("Language")
Siebel eScript:
var curLang;
curLang = TheApplication().InvokeMethod("Language");
LookupValue Method
Finds a row in S_LST_OF_VAL where the TYPE column matches the type argument, the CODE column
matches the lang_ind_code argument, and the LANG_ID column matches the language code of the
currently active language. This function is used to obtain the translation of the specified untranslated
value in the specified LOV into the currently active language.
Syntax
val = Application.InvokeMethod(LookupValue, type, lang_ind_cd)
Argument Description
Returns
Returns a string containing the display value (the VAL column) for the row. LookupValue tries to find
the display value for a given language independent code. If the display value is not found,
LookupValue returns the language independent code itself as the value.
Used With
This method is supported by Application.InvokeMethod() calls in COM Data Control, Java Data Bean,
Mobile Web Client Automation Server, and Server Script.
Example
The following eScript example finds a row in S_LST_OF_VAL where the TYPE column matches the
type argument, the CODE column matches the lang_ind_code argument, and the LANG_ID column
matches the language code of the currently active language. This function is used to obtain the
translation of the specified untranslated value in the specified LOV into the currently active language.
var LOVText=TheApplication().InvokeMethod("LookupValue","SR_AREA","Network");
LoadObjects Method
The LoadObjects method is used to start the COM Data Server object, and returns a reference to the
Application object. This method must be the first call to the COM Data Server.
Syntax
Application.LoadObjects(absoluteCFGfileName)
Argument Description
absoluteCFGfileName The complete path and name of the CFG file to open. For example:
C:\siebel\bin\uagent.cfg
You can optionally identify the data source in the argument to the
LoadObjects method by appending to the CFG file string, separated by
a comma. For example:
"D:\Server\siebsrvr\bin\ENU\siebel.cfg,ServerDataSrc"
Returns
The Application object opened on start-up
Usage
Prior to calling LoadObjects, you must change the current directory to the Siebel\bin directory.
When using COM Data Server, the COM client cannot create multiple connections to the COM Server.
For example, a second attempt at calling LoadObjects() causes the error message: The object
definition manager has already been initialized. The COM client must be restarted before another
connection attempt can be successful. Use COM Data Control instead.
Used With
COM Data Server
Example
The following example is for COM Data Server. SiebelApplication is an Application instance.
If errCode = 0 Then
ConfigOK = 1
End If
Status.Text = SiebelApplication.GetLastErrText
End Sub
LoadUserAttributes Method
The LoadUserAttributes method loads a user profile into the session.
Syntax
LoadUserAttributes(row_id)
Argument Description
Returns
Not applicable
Usage
This function has only one argument: the row ID of the user whose profile needs to be loaded. This
loaded profile can be accessed as the You profile from personalization rules, with one exception: if
the row ID is that of the current user, the profile will be loaded into the Me profile.
If this function is called with no argument, it unloads the loaded user profile.
For more information on user profiles, see Siebel Personalization Administration Guide.
Used With
Server Script
Example
The following Siebel VB example shows a method that loads a user profile into the session. The
function is exposed on the Siebel Application Object.
Login Method
The Login method allows external applications to log in to the COM Data Server, COM Data Control,
or Java Data Bean, and to access the Siebel objects. The Login method allows the end user to invoke
the Siebel application without being prompted for a login and password. The Login method
determines the privileges granted, and the role and responsibility of the end user for that session.
Syntax
Application.Login([connectString,] userName, password)
Argument Description
Returns
A string containing the error code
Usage
Verify that the Siebel\bin directory is the current directory. To access the Data Control, make sure
the default Data Source points to the database that you wish to access and set EnableOLEAutomation
to TRUE in your CFG file (this is the default value for the argument).
For information on formatting the connect string, read Connect String on page 71.
Used With
COM Data Control, COM Data Server, Mobile Web Client Automation Server, Java Data Bean
Example
The connect string for the COM Data Control is token-based; for example:
Because most languages use quotes to enclose text strings, you must use quotes inside parentheses;
for example:
m_dataBean.login("siebel.tcpip.none.none://gateway:gatewayport/enterpriseserver/
SCCObjMgr", "username", "password");
Login("host=\"siebel://my_computer/SIEBEL/objsvr/my_computer\" lang =
\"ENU\"","user","password");
The following code sample illustrates how to log in to the server and check for errors:
Call SiebelAppControl.Login("host=""siebel://gtwy/enterprise/ObjMgr""",
"SADMIN", "SADMIN")
The following is a Java Data Bean example that logs into a Siebel Server and then logs off:
import com.siebel.data.*;
import com.siebel.data.SiebelException;
public JDBLoginLogoffDemo()
{
try
{
// logoff
m_dataBean.logoff();
System.out.println("Logged off the Siebel server ");
}
catch (SiebelException e)
{
System.out.println(e.getErrorMessage());
}
}
}
LoginId Method
The LoginId method returns the login ID of the user who started the Siebel application.
Syntax
Application.LoginId
Argument Description
Not applicable
Returns
A string containing the login ID
Usage
The login ID is the row ID of the users login in the Employee table. When obtained, the login ID can
be conveniently used as a search specification.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
In this Siebel VB example of the BusComp_PreSetFieldValue event, the LoginId method is used to
determine whether the user has the right to modify a record.
LoginName Method
The LoginName method returns the login name of the user who started the Siebel application (the
name typed in the login dialog box).
Syntax
Application.LoginName
Argument Description
Not applicable
Returns
A string containing the users login name
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
For examples, read ExecuteQuery Method on page 190 and TheApplication Method on page 317.
Related Topic
Login Method on page 145
Logoff Method
The Logoff method disconnects the client from the server.
Syntax
Application.Logoff
Argument Description
Not applicable
Returns
Not applicable
Usage
For clients with user interfaces, Logoff destroys every window except for the topmost window. Logoff
also deletes every object, except for the topmost object, on both client and server.
Used With
COM Data Control, Java Data Bean, Mobile Web Client Automation Server
LookupMessage Method
The LookupMessage method returns the translated string for the specified key, in the current
language, from the specified category. The optional arguments are used to format the string if it
contains any substitution arguments (%1,%2).
Syntax
Application.LookupMessage (category, key, [arg1], [arg2],...., [argN])
Argument Description
category Name of the Message Category object, as defined in Siebel Tools, that
is the parent of Key value.
key Name of the Message object, as defined in Siebel Tools, whose text
contains the value to be investigated.
arg1, arg2, , argN Optional arguments used to format the error message if it contains any
substitution arguments (%1, %2).
Returns
A string containing the localized message text.
Usage
Useful for retrieving locale specific custom error messages.
Used With
Server Script
Example
The following eScript example returns the text Account Title should be entered before Stepping off.
To test this under the User Defined Errors message category, create a new record with the following
text: %1 should be entered before Stepping Off. The parameter that is substituted in place of %1
is Account Title, which is present in the message test.
Name Method
The Name method returns name of the application.
Syntax
Application.Name
Argument Description
Not applicable
Returns
A string containing the name of the application
Used With
Browser Script, Web Client Automation Server
NewPropertySet Method
The NewPropertySet method constructs a new property set object.
Syntax
Application.NewPropertySet
Argument Description
Not applicable
Returns
A property set
Usage
NewPropertySet is used primarily to construct input and output arguments for business services.
NOTE: When using NewPropertySet on an existing PropertySet object, old references to this
PropertySet are lost. When reusing a PropertySet, use the Reset method on the PropertySet itself.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script, Web Client Automation Server
Example
This method constructs a new property set object.
else
{
return ("ContinueOperation");
}
}
else
{
return (ContinueOperation);
}
End Function
PositionId Method
The PositionId property returns the position ID (ROW_ID from S_POSTN) of the users current
position. This is set by default when the Siebel application is started and may be changed (through
Edit > Change Position) if the user belongs to more than one position.
Syntax
Application.PositionId
Argument Description
Not applicable
Returns
A string row ID
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
PositionName Method
The PositionName property returns the position name of the users current position. This is set by
default when the Siebel application is started.
Syntax
Application.PositionName
Argument Description
Not applicable
Returns
A string containing the users position
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
This Siebel VB example checks for the position of a user changing the sales stage, and prevents
changes if the user is not of the appropriate position.
End Function
RaiseError Method
The RaiseError method raises a scripting error message to the browser. The error code is a canonical
number. The error text is based on the specified key, looked up for the current language from the
User-Defined Errors category. You can define these errors in Tools using the Message Category
object. The optional arguments are used to format the string if it contains any substitution
arguments (%1, %2).
Syntax
Application.RaiseError(key, [arg1], [arg2],...., [argN])
Argument Description
key Name of the Message object, as defined in Siebel Tools, whose text
contains the value to be used.
arg1, arg2, , argN Optional arguments used to format the error message if it contains any
substitution arguments (%1, %2).
Returns
Not applicable
Usage
When invoked, the RaiseError method causes execution of the script to terminate, and sends a
notification to the browser. Therefore, CancelOperation is not required after RaiseError.
Internally, the RaiseError/RaiseErrorText methods raise a Server Script exception. Therefore, if you
have implemented error handling in your scripts, please note that the error handling can suppress
RaiseError/RaiseErrorText functionality.
If you have implemented error handling in Siebel VB, remember that when using On Error Goto ,
the RaiseError and RaiseErrorText methods result in the script transferring execution to the error
handler. On Error Resume Next suppresses the RaiseError and RaiseErrorText methods.
Used With
Server Script
Example
In the following eScript example, the RaiseError results in a scripting exception being raised,
transferring control to the catch statement. To display the error message, the error must be thrown
using the throw statement.
function BusComp_PreDeleteRecord ()
{
try {
var status = this.GetFieldValue("Account Status");
if (status == "Gold") {
TheApplication().RaiseError(<user defined error name>);
}
else {
return (ContinueOperation);
}
}
catch (e) {
throw e;
}
The following eScript example raises the error message This user-defined test error is used in
PreDelete, as an example for RaiseError Method when deleting an opportunity with the Pipeline
revenue class. Note that the key "user-defined test error1" is predefined as "This user-defined test
error is used in %1, as an example for %2". When the script runs, 'PreDelete' is substituted for %1
and 'Raise Error Method' is substituted for %2.
function BusComp_PreDeleteRecord ()
{
try
{
var revClass = this.GetFieldValue("Primary Revenue Class");
if (revClass == "1-Pipeline")
{
TheApplication().RaiseError("user-defined test error1", "PreDelete",
"RaiseError Method" );
}
else
{
return (ContinueOperation);
}
}
catch (e)
{
throw e;
}
RaiseErrorText Method
The RaiseErrorText method raises a scripting error message to the browser. The error text is the
specified literal string. The optional arguments are used to format the string if it contains any
substitution arguments (%1, %2).
Syntax
Application.RaiseErrorText(value, [arg1], [arg2],...., [argN])
Argument Description
arg1, arg2, , argN Optional arguments used to format the error message if it contains any
substitution arguments (%1, %2).
Returns
Not applicable
Usage
When invoked, the RaiseErrorText method stops execution of the script. Therefore, CancelOperation
is not required after RaiseErrorText.
Internally, the RaiseError and RaiseErrorText methods raise a Server Script exception. Therefore, if
you have implemented error handling in your scripts, the error handling can suppress RaiseError and
RaiseErrorText functionality.
If you have implemented error handling in Siebel VB and are using On Error Goto , the RaiseError
and RaiseErrorText methods result in the script transferring execution to the error handler. On Error
Resume Next suppresses the RaiseError and RaiseErrorText methods.
NOTE: Do not use the %s and %n formatting literals with the RaiseErrorText method. This causes
unpredictable results.
Used With
Server Script
Example
In the following eScript example, the RaiseErrorText results in a scripting exception being raised,
transferring control to the catch statement. For the error message to be displayed, the error must
be thrown, using the throw statement.
function BusComp_PreDeleteRecord ()
{
try {
var status = this.GetFieldValue("Account Status");
if (status == "Gold") {
TheApplication().RaiseErrorText("Unable to delete Gold Account");
}
else {
return (ContinueOperation);
}
}
catch (e) {
throw e;
}
The following eScript example raises an error when deleting an opportunity with the Pipeline
revenue class.
function BusComp_PreDeleteRecord ()
{
try
{
var revClass = this.GetFieldValue("Primary Revenue Class");
if (revClass == "1-Pipeline")
{
TheApplication().RaiseErrorText("Exception occurred in %1. Unable to
delete Opportunity with %2 revenue class.", "PreDeleteRecord", revClass);
}
else
{
return (ContinueOperation);
}
}
catch (e)
{
throw e;
}
}
SetPositionId Method
SetPositionID sets the active position to the Position Id specified in the argument.
Syntax
Application.SetPositionId(positionId)
Argument Description
Returns
A Boolean denoting whether or not the operation was successfully completed
Usage
When invoking the SetPositionId method, the positionId argument must contain a Position Id that
has already been associated with the current, logged-in user.
Used With
COM Data Server, COM Data Control, Java Data Bean, Mobile Web Client Automation Server, Server
Script
SetPositionName Method
SetPositionName sets the active position to the position name specified in the argument. Returns a
Boolean indicating whether or not method succeeded.
Syntax
Application.SetPositionName(positionName)
Argument Description
Returns
A Boolean denoting whether or not the operation was successfully completed
Usage
When invoking the SetPositionName method, the positionName argument must contain a Position
name that has already been associated with the current, logged-in user.
Used With
COM Data Server, COM Data Control, Java Data Bean, Mobile Web Client Automation Server, Server
Script
SetProfileAttr Method
SetProfileAttr is used in personalization to assign values to attributes in a user profile.
Syntax
Application.SetProfileAttr(name, value)
Argument Description
Returns
Not applicable
Usage
SetProfileAttr assigns the value value to the attribute in a user profile indicated by name. If the
profile attribute specified in the argument string already exists, the corresponding persistent profile
attribute in the application, defined in the Personalization Profile business component, is updated
with the new value. If the profile attribute specified in the argument string does not exist in the list
of persistent profile attributes, it is created as a dynamic profile attribute, without quotation marks
encompassing the name.
In Browser Script, using SetProfileAttr() triggers a round trip to the server and back, creating a
performance overhead each time it is used.
NOTE: SetProfileAttr() cannot be used with system fields, which are not explicitly defined in the
Personalization Profile business component. While GetProfileAttr() can be used with the Id field,
SetProfileAttr() cannot be used with it, because attempting to change the ROW_ID column of a table
will generate an error. For more information on system fields, see Configuring Siebel Business
Applications.
Used With
Browser Script, COM Data Control, COM Data Server, Server Script, Java Data Bean, Mobile Web
Client Automation Server
Example
The following example is in Browser Script:
{
if (name == "hobbyReq") {
var hobby = theApplication().GetProfileAttr("Hobby");
if (hobby == "") {
hobby = prompt("Please enter your favorite hobby");
theApplication().SetProfileAttr("Hobby", hobby);
}
return ("CancelOperation");
}
else
return ("ContinueOperation");
}
This following examples show how to exchange information between applet server scripts and applet
browser scripts. In an applet server script, a customer profile attribute called MyProAttr is set to
Hello World using the SetProfileAttr method. In applet browser scripts, you can retrieve the profile
attribute using GetProfileAttr method.
if (MethodName == "MyCustomMethod") {
}
return (ContinueOperation);
End Function
Related Topics
Name Method on page 150
For more information on user profile attributes, read Siebel Applications Administration Guide.
SetSharedGlobal Method
Shared global variables are unique to the user and the users associated session. One user's global
variables are not visible to other users. The variables are global to the current user and session only.
The SetSharedGlobal property sets a shared user-defined global variable, which can be accessed
using GetSharedGlobal.
Syntax
Application.SetSharedGlobal(varName, value)
Argument Description
varName String variable or literal containing the name of the shared global variable to set
value String variable or literal containing the value to set the variable to set
Returns
Not applicable
Used With
COM Data Control, COM Data Server, Mobile Web Client Automation Server, Server Script
Example
The following example is for COM. SiebelApplication is an Application instance.
In this example, the SetSharedGlobal method is called to set a global variable called myGlobalVar in
Application_Start event. The global variable can be accessed from any event. For this example, in
the BusComp_WriteRecord event, the GetSharedGlobal method is called to retrieve the global
variable.
function BusComp_WriteRecord ()
{
var myVar;
myVar = TheApplication().GetSharedGlobal("myGlobalVar");
}
Sub BusComp_WriteRecord
Dim myVar as String
myVar = TheApplication.GetSharedGlobal("myGlobalVar")
End Sub
Related Topic
GetLastErrCode Method on page 129
ShowModalDialog Method
ShowModalDialog allows you to show a modal dialog box with the cursor maintained in its default
state. This Application object method invokes Microsofts equivalent Window object method.
Syntax
theApplication().ShowModalDialog (url[, argin][, options])
Argument Description
Argument Description
argin This parameter is used to pass arguments to use when displaying the document.
This argument can be a value of any type, including an array of values.
options String that specifies the attributes of the window that displays the dialog box.
dialogHeight:sHeight sets the height of the dialog window, where sHeight can
be an integer or floating-point number, followed by an absolute units
designator (cm, mm, in, pt, pc, or px) or a relative units designator (em or
ex). For consistent results, specify the dialogHeight and dialogWidth in pixels
when designing modal dialog boxes. Default unit of measure is em. Minimum
height is 100 pixels.
dialogLeft:sXPos sets the left position of the dialog window relative to the
upper-left corner of the desktop.
dialogTop:sYPos sets the top position of the dialog window relative to the
upper-left corner of the desktop.
edge:{ sunken | raised } specifies the edge style of the dialog window. The
default is raised.
Returns
The value of the returnValue property, as set by the window of the document specified by the url
parameter
Used With
Browser Script
Example
This example shows how this method can be used in browser script to bring up a modal dialog box
with a specified URL.
function Applet_Load ()
{
var sOptions="dialogHeight: 1000px;edge:sunken;resizable;yes";
theApplication().ShowModalDialog("http://www.yahoo.com", "", sOptions)
}
SWEAlert Method
SWEAlert displays a modal dialog box containing a message to the user.
Syntax
theApplication().SWEAlert(message)
Returns
Undefined (similar to returning nothing)
Usage
Use SWEAlert instead of Alert. With Alert, popup applets such as Mvg and Pick applets are hidden
(sent to the background) when a JavaScript Alert() is raised by a Browser side event. With SWEAlert,
the dialog's parent applet is not sent to the foreground.
Used With
Browser Script
Example
The following browser script example displays a status message to the user.
return ("CancelOperation");
}
else
return ("ContinueOperation");
}
else
return ("ContinueOperation");
}
Trace Method
The Trace method appends a message to the trace file. Trace is useful for debugging SQL query
execution and the allocation of the objects. This tracing is not the same as the tracing that can be
activated in the applications CFG file. For more information, read Tracing Scripts on page 18.
NOTE: This method and the TraceOn Method on page 168 are meant for debugging purposes and are
not recommended for use in production environments.
Syntax
Application.Trace(message)
Argument Description
message String variable or literal containing message text to append to the trace file
Returns
Not applicable
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
The following example is for COM Data Server. SiebelApplication is an Application instance.
Sub Button2_Click
TheApplication.TraceOn "C:\temp\trace.txt", "allocation", "all"
TheApplication.TraceOn "C:\temp\trace.txt", "sql", ""
TheApplication.Trace "start of tracing!"
End Sub
Related Topics
TraceOff Method
TraceOn Method on page 168
TraceOff Method
TraceOff turns off the tracing started by the TraceOn method.
Syntax
Application.TraceOff
Argument Description
Not applicable
Returns
Not applicable
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
This Siebel VB example sets the value in the Sales Stage field to the default, that is, to the first value
in the fields picklist, and uses tracing to track the result:
Sub BusComp_NewRecord
TheApplication.TraceOn "C:\lvpick.doc", "SQL", ""
Dim oBC as BusComp
set oBC = me.GetPickListBusComp("Sales Stage")
With oBC
.SetViewMode AllView
.ActivateField "Sales Stage Order"
.ClearToQuery
.SetSortSpec "Sales Stage Order"
.ExecuteQuery ForwardOnly
if .FirstRecord then
.Pick
end if
End With
TheApplication.TraceOff
End Sub
TraceOn Method
TraceOn turns on the tracking of allocations and deallocations of Siebel objects and SQL statements
generated by the Siebel application.
Syntax
Application.TraceOn(filename, type, selection)
Argument Description
filename Output filename for the trace messages. If this argument is not specified, tracing
information is logged to the Object Manager log file for that user session.
The filename argument can take two additional inline arguments: $p and $t. The $p
argument substitutes the process id to the filename, and $t substitutes the thread
id to the file name. For example:
TheApplication().TraceOn("d:\\temp\\trace_$p_$t.txt", "Allocation",
"All");
d:\temp\trace_112.txt
If user B had a process id of 11, and a thread id of 2, their tracing file would be
d:\temp\trace_112.txt
As a result, both users would attempt to log to the same file. Adding a separator
between the process and thread id keeps the filenames unique.
d:\temp\trace_1_12.txt
d:\temp\trace_11_2.txt
type Specifies the type of tracing to start. This can have the following values:
selection Indicates which Siebel objects should be traced for the Allocation trace type. This
argument should be "" if the trace type is SQL.
All. Traces all objects. The All value does not trace the Siebel objects managed
implicitly by Siebel's declarative configuration use. All traces the Siebel objects
constructed by scripting.
Returns
Not applicable
Usage
Always issue TraceOff to turn off tracing. If you attempt to call TraceOn with a different filename
without calling TraceOff first, trace information is written to the new trace filename. You can issue
multiple TraceOn statements to the same trace file.
NOTE: This method and the Trace Method on page 165 are meant for debugging purposes and are
not recommended for use in production environments.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
The following example is for COM Data Server. SiebelApplication is an Application instance:
{
TheApplication().TraceOn("d:\\temp\\trace.txt", "Allocation", "All");
TheApplication().TraceOn("d:\\temp\\trace.txt", "SQL", "");
TheApplication().Trace("start tracing!");
return (ContinueOperation);
}
Sub Button2_Click
TheApplication.TraceOn "C:\temp\trace.txt", "allocation",
"all"
TheApplication.TraceOn "C:\temp\trace.txt", "sql", ""
TheApplication.Trace "start of tracing!"
End Sub
The following examples show the use of Trace, Traceoff, and TraceOn methods to generate a trace
file with SQL statements issues by the scripting query.
function BusComp_NewRecord ()
{
TheApplication().TraceOn("C:\\trace_output.txt", "SQL", "");
TheApplication().Trace("Start of tracing!");
var oBC = this.GetPickListBusComp("Sales Stage");
with (oBC)
{
SetViewMode(AllView);
ActivateField("Sales Stage Order");
ClearToQuery();
SetSortSpec("Sales Stage Order(ASCENDING)");
ExecuteQuery(ForwardOnly);
if (FirstRecord())
{
Pick();
}
}
oBC = null;
TheApplication().Trace("End of tracing!");
TheApplication().TraceOff();
}
Sub BusComp_NewRecord
With oBC
.SetViewMode AllView
.ActivateField "Sales Stage Order"
.ClearToQuery
.SetSortSpec "Sales Stage Order"
.ExecuteQuery ForwardOnly
If .FirstRecord Then
.Pick
End If
End With
Related Topics
Trace Method on page 165
TraceOff Method on page 167
Application Events
The following topics describe application events:
Application_Close Event
Application_Close Event
The Close event is called before the application exits. This allows scripts to perform last-minute
cleanup (such as cleaning up a connection to a COM server). It is called when Windows notifies the
application that it should close, but not if the process is terminated directly.
Syntax
Application_Close
Argument Description
Not applicable
Returns
Not applicable
Used With
Server Script
NOTE: Siebel Business Processes invokes this event. For more information, read Siebel Business
Process Framework: Workflow Guide.
Application_InvokeMethod Event
The Application_InvokeMethod event is called after a specialized method is invoked.
Argument Description
Argument Description
Returns
Returns TRUE if the call succeeds or FALSE if it does not succeed.
Usage
The InvokeMethod event is called just after a specialized or user-defined method is invoked on the
application.
Used With
Browser Script, Server Script
Related Topics
How Your Script Affects Program Flow on page 64
Application_PreInvokeMethod Event
Application_Navigate Event
The Application_Navigate event is called after the client has navigated to a view.
Syntax
Application_Navigate
Argument Description
Not applicable
Returns
Not applicable
Used With
Server Script
Application_PreInvokeMethod Event
The PreInvokeMethod event is called before a specialized method is invoked by a user-defined applet
menu or by calling InvokeMethod on the application.
Argument Description
methodName String variable or literal containing the name of the method invoked
Argument Description
methodName String variable or literal containing the name of the method invoked.
Returns
ContinueOperation or CancelOperation
Usage
The PreInvokeMethod event is called just before a specialized method is invoked on the application.
If implementing a user-defined method, the script should return CancelOperation if you wish to
handle the event entirely through your own scripting.
Specialized methods are methods based on applet or business component classes other than
CSSFrame and CSSBusComp, respectively, that is, specialized classes.
When the method to be invoked is part of an If statement, this functions return value must be
assigned before the End If statement, as in the following code fragment.
CancelOperation stops the execution of the underlying Siebel code associated with the event.
However, if there is code in the same script following CancelOperation, that code runs regardless of
the CancelOperation.
Used With
Browser Script, Server Script
Example
The following example is in Siebel VB and shows an implementation of the PreInvokeMethod:
Dim i As Integer
Dim iReturn As Integer
iReturn = ContinueOperation
Case "LaunchExcel"
i = Shell("C:\Program Files\Microsoft Office _
\Office\EXCEL.EXE",1)
iReturn = CancelOperation
End Select
Application_PreInvokeMethod = iReturn
End Function
The following is the equivalent sample in Siebel eScript. Note that for this script to run, the entire
Clib.system statement must appear on a single line in the Editor:
switch (MethodName)
{
case "LaunchWord":
Clib.system("\"C:\\Program Files\\Microsoft Office
\\Office\\WINWORD.EXE"",1);
iReturn = CancelOperation;
break;
case "LaunchExcel":
Clib.system("\"C:\\Program Files\\Microsoft Office
\\Office\\EXCEL.EXE"",1);
iReturn = CancelOperation;
}
return (iReturn)
}
Related Topic
How Your Script Affects Program Flow on page 64
Application_PreNavigate Event
The Application_PreNavigate event is called before the client navigates to a view.
Syntax
Application_PreNavigate(DestViewName, DestBusObjName As String) As Integer
Argument Description
Returns
CancelOperation or ContinueOperation
Used With
Server Script
Example
In the following eScript code sample the script checks for the current business object (contact) and
sets the current contact id as global variable (can be used for keeping context):
Application_Start Event
The Start event is called when the client starts and again when the user interface is first displayed.
Syntax
Application_Start(commandline)
Argument Description
commandline Text of the command line with which the Siebel application was started.
NOTE: Siebel Business Processes invoke this event. For more information, read Siebel Business
Process Framework: Workflow Guide.
Returns
Not applicable
Used With
Server Script
Example
This Siebel VB code should be placed in the Application_Start procedure for the application of your
choice. This example retrieves the first and last name of the user logging into the Siebel application:
sLoginName = TheApplication.LoginName
Set oEmpBusObj = TheApplication.GetBusObject("Employee")
Set oEmpBusComp = oEmpBusObj.GetBusComp("Employee")
With oEmpBusComp
.ActivateField "First Name"
.ActivateField "Last Name"
.ClearToQuery
.SetSearchSpec "Login Name", sLoginName
.ExecuteQuery
If (.FirstRecord = 1) Then
sUserName = .GetFieldValue("First Name")
sUserName = sUserName + " " + .GetFieldValue("Last Name")
End If
End With
ActivateField Method
ActivateField allows queries to retrieve data for the argument-specified field.
Syntax
BusComp.ActivateField(FieldName)
Argument Description
FieldName String variable or literal containing the name of the field to activate
Returns
Not applicable
Usage
FieldName must be enclosed in double quotes and must be spelled exactly as the field name appears
in Siebel Tools, using the same case. You must activate fields using ActivateField before executing a
query for the business component.
NOTE: If you are writing an event handler on a business component, you must make sure that the
field has already been activated by specifying the ForceActive user property on the control.
They are displayed on the applet and the business component is the instance on which the applet
is based.
They are System fields (which include Id, Created, Created By, Updated, and Updated By).
After a business component has been executed, if additional fields are activated, the business
component must be requeried before field values can be accessed. Failure to requery the business
component results in a value of 0 being returned. The ActivateField method destroys the context of
a query when it is used after the ExecuteQuery method.
The ActivateField method forces the specified field to be included in the SQL statement that is
initiated by an ExecuteQuery method that follows. ActivateField should always be followed by
ExecuteQuery. If a field is activated and then referenced by a GetFieldValue or SetFieldValue
statement prior to an ExecuteQuery statement, the activation has no effect. The activated field is not
retrieved through a query, so it contains an empty value.
If a field is not activated prior to a WriteRecord, the data is written to the database, but corruption
issues may arise when mobile users synchronize. An ActivateField call prior to an ExecuteQuery call,
followed by a WriteRecord, makes sure that the field is written correctly to the transaction log so that
changes made by mobile users are saved back to the server database correctly at synchronization
time.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
The following example is in Siebel VB. For an equivalent Siebel eScript example, read ClearToQuery
Method on page 185.
oEmpBusComp.ClearToQuery
oEmpBusComp.SetSearchSpec "Login Name", sLoginName
oEmpBusComp.ExecuteQuery
Set oEmpBusComp = Nothing
Related Topic
DeactivateFields Method on page 187
ActivateMultipleFields Method
Use ActivateMultipleFields to activate data for the fields specified in the property set.
Syntax
BusComp.ActivateMultipleFields(SiebelPropertySet sps)
Argument Description
Returns
TRUE if success; FALSE if failure
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
The following example is for Java Data Bean:
import com.siebel.data.*;
...
//Create Siebel Data Bean.
//login into Siebel Data Bean
...
//Create Siebel Bus Object.
//Get the Bus Object from SiebelDataBean
...
//Create Siebel Bus Comp siebBusComp
//Get the business component using SiebelBusObject
ps.setProperty("Description","");
ps.setProperty("Name","");
siebBusComp.ActivateMultipleFields(ps);
...
The following Siebel eScript example queries the Contact business component and retrieves the First
Name and Last Name of the first contact found:
Related Topics
SetMultipleFieldValues Method on page 233
GetMultipleFieldValues Method on page 203
Associate Method
The Associate method creates a new many-to-many relationship for the parent object through an
association business component (see GetAssocBusComp).
Syntax
BusComp.Associate(whereIndicator)
Argument Description
whereIndicator This argument should be one of the following predefined constants or the
corresponding integer: NewBefore (0) or NewAfter (1), as in NewRecord.
Returns
Not applicable
Usage
To set field values on a child record that has been associated to a parent record, use the context of
the MVGBusComp.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
The following VB example updates the Opportunity Assignment Type field. The parent business
component can be any business component that includes the Sales Rep multi-value group.
The following Siebel eScript example finds a contact with the Last Name = Abanilla, and adds a new
organization named CKS Software to its Organization MVG.
var ok = 0;
var ContactBO= TheApplication().GetBusObject("Contact");
var ContactBC = ContactBO.GetBusComp("Contact");
with (ContactBC)
{
ClearToQuery();
SetViewMode(AllView);
oAssocBC.ClearToQuery();
oAssocBC.SetSearchSpec("Name", "CKS Software");
oAssocBC.ExecuteQuery ();
catch (e)
{
ok = 0;
TheApplication().RaiseErrorText("Error Associating new Organization");
}
} // if oAssocBC.FirstRecord
} // if FirstRecord
} // With ContactBC
Related Topics
NewRecord Method on page 221
FirstSelected Method on page 194
GetMVGBusComp Method on page 203
BusObject Method
The BusObject method returns the business object that contains the business component.
Syntax
BusComp.BusObject
Argument Description
Not applicable
Returns
The business object that contains the business component
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script
Example
For an example, read SetViewMode Method on page 245.
Related Topic
ActiveBusObject Method on page 118
ClearToQuery Method
The ClearToQuery method clears the current query but does not clear sort specifications on the
BusComp.
Syntax
BusComp.ClearToQuery
Argument Description
Not applicable
Returns
Not applicable
Usage
Any fields to be queried must be activated before ClearToQuery. For more information, read
ActivateField Method on page 179.
Search and sort specifications sent to the business component are cumulative; the business
component retains and logically performs an AND operation on query qualifications since the last
ClearToQuery, except for new search specifications on a field for which a search specification has
previously been set. In that circumstance, the new specification replaces the old.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
The following example is in Siebel eScript. For Siebel VB examples, read Applet_PreInvokeMethod
Event on page 104, ActivateField Method on page 179, and ExecuteQuery Method on page 190. For
another eScript example, read GotoView Method on page 135.
oEmpBusComp.ClearToQuery();
oEmpBusComp.SetSearchSpec("Login Name", sLoginName);
oEmpBusComp.ExecuteQuery();
oEmpBusComp = null;
oEmpBusObj = null;
Related Topic
RefineQuery Method on page 227
CountRecords Method
CountRecords uses database aggregation to count the records returned by the last ExecuteQuery()
call.
Syntax
BusComp.CountRecords()
Argument Description
Not applicable
Returns
An integer indicating the number of records returned by the last ExecuteQuery() call.
Used With
Server Script
Examples
The following example is in Siebel eScript:
ExecuteQuery();
var count = CountRecords();
}
// other code..
return (CancelOperation);
}
return (ContinueOperation);
}
DeactivateFields Method
DeactivateFields deactivates the fields that are currently active from a business component SQL
query statement, except those that are not ForceActive, required for a link, or required by the
BusComp class.
Syntax
BusComp.DeactivateFields
Argument Description
Not applicable
Returns
Not applicable
Usage
You must activate fields using ActivateField prior to executing a query for the business component.
They are displayed on the applet and the business component is the instance on which the applet
is based.
They are System fields (which include Id, Created, Created By, Updated, and Updated By).
After fields have been deactivated, the business component must be reexecuted or the application
crashes.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Examples
The following example is for COM. SiebelApplication is an Application instance.
var oBC;
var oBO;
oBO = TheApplication().GetBusObject("Account");
oBC = oBO.GetBusComp("Account");
oBC.DeactivateFields();
oBC.ActivateField("Name");
oBC.ActivateField("Location");
oBC.ClearToQuery();
oBC.ExecuteQuery(ForwardOnly);
oBC = null;
oBO = null;
Related Topic
ActivateField Method on page 179
DeleteRecord Method
DeleteRecord removes the current record from the business component.
Syntax
BusComp.DeleteRecord
Argument Description
Not applicable
Returns
Not applicable
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
This Siebel VB example illustrates how to delete accounts with a status of Inactive:
Sub DeleteInactiveAccounts()
Dim objBO as BusObject
Dim objBC as BusComp
NOTE: The cursor is moved to the next record after DeleteRecord is executed. Therefore, it is not
necessary to execute NextRecord after DeleteRecord. Do not use NextRecord after DeleteRecord in
a loop because this causes the deletion of the last record in the loop to be skipped. If you use
DeleteRecord on the last record, the cursor points to nothing.
ExecuteQuery Method
ExecuteQuery returns a set of business component records using the criteria established with
methods such as SetSearchSpec.
Syntax
BusComp.ExecuteQuery ([cursorMode])
Argument Description
cursorMode An integer. An optional argument that must be one of the following constants
(provided in Siebel VB as well as COM Servers):
ForwardOnly. Selected records can be processed only from the first record
to the last record. Focus cannot return to a record.
Returns
Not applicable
Usage
Use a cursorMode of ForwardOnly wherever possible to achieve maximum performance. If you use
ForwardOnly, make sure that your application code does not attempt to navigate backward using
PreviousRecord or FirstRecord without a requery. Do not use ForwardOnly when operating on UI
business components unless the application code requeries using a cursorMode of ForwardBackward.
When using the ForwardBackward cursor mode, and the query matches over 10,000 records, the
object manager returns this error message: There were more rows than could be returned. Please
refine your query to bring back fewer rows.
To reduce the number of queries needed, you can use the parent-child relationships for business
components that are set up in business objects. For example, an Opportunity business object sets
up a parent-child relationship between the Opportunity business component and the Contact
business component. If you query on the Opportunity business component you can read values from
the corresponding records in the Contact business component without any additional queries. Before
querying a child business component, you must query its parent, otherwise the query returns no
records.
NOTE: You must activate fields by using the ActivateField method before executing a query for a
business component. If you are writing an event handler on a business component, you must make
sure that the field has already been activated by specifying the ForceActive user property on the
control.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
This Siebel VB example sets up and executes a query to find the primary on the account team. Only
the primary can change the primary address. For other examples, read Applet_PreInvokeMethod
Event on page 104, GotoView Method on page 135, and ClearToQuery Method on page 185.
(general) (declarations)
Option Explicit
Function BusComp_PreSetFieldValue (FieldName As String,
FieldValue As String) As Integer
Dim i As Integer
Dim iFoundP As Integer ' 1 = found (TRUE), 0 = not found (FALSE)
Dim oMVGBC as BusComp
iFoundP = FALSE
Select Case FieldName
Case "SSA Primary Field"
set oMVGBC = me.ParentBusComp.GetMVGBusComp("Sales Rep")
With oMVGBC ' this is the position BC
.ActivateField "Active Login Name"
.ActivateField "SSA Primary Field"
.ClearToQuery
.ExecuteQuery ForwardBackward
i = .FirstRecord
Do While i <> 0
if .GetFieldValue("SSA Primary Field") = "Y" then
iFoundP = TRUE 'mark that found a primary
if.GetFieldValue("Active Login Name") <> TheApplication.LoginName then
TheApplication.RaiseErrorText"You cannot change the Primary address
because you are not the Primary on the Account Team")
end if
Exit Do
else
i = .NextRecord
end if
Loop
if iFoundP = FALSE then
.FirstRecord
TheApplication.RaiseErrorText("No Primary Found - Contact an Administrator")
end if
End With
End Select
End Function
Related Topics
ActivateField Method on page 179
ClearToQuery Method on page 185
SetSearchSpec Method on page 238
ExecuteQuery2 Method
ExecuteQuery2 returns a set of business component records using the criteria established with
methods such as SetSearchSpec.
Syntax
BusComp.ExecuteQuery2 ([cursorMode], ignoreMaxCursorSize)
Argument Description
cursorMode An integer. An optional argument that can be one of the following two
constants (provided in Siebel VB as well as COM Servers):
ignoreMaxCursorSize TRUE. Retrieves every row from a business component. This option
may result in lower performance.
Returns
Not applicable
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
FirstRecord Method
FirstRecord moves the record pointer to the first record in a business component, making that record
current and invoking any associated script events.
NOTE: When executing a query on a business component, SQL is generated for any active child
business component. Calling the FirstRecord method triggers the BusComp_ChangeRecord event and
causes the same SQL for the child business component to execute again.
Syntax
BusComp.FirstRecord
Argument Description
Not applicable
Returns
An integer in Siebel VB: 1 or nonzero if there was a first record (the query returned results) and 0
if there are no records; a Boolean in Siebel eScript, COM, and ActiveX.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Examples
The following examples show how the FirstRecord method could be used to check whether an Account
displayed in a child applet (for example, the Account List Applet - child applet in the Contact Detail
- Accounts View) has any service requests associated to it. The outcome of this could then determine
whether other code should be run against the Account record.
with (oBC)
{
SetViewMode(AllView);
ClearToQuery();
SetSearchSpec("Account Id", strAccntId);
ExecuteQuery(ForwardOnly);
if (FirstRecord())
{
else
{
TheApplication().RaiseErrorText("No Service Requests Associated To This
Account.")
}
return (CancelOperation);
}
return (ContinueOperation);
}
iRtn = ContinueOperation
''CheckSR' method invoked from a custom button On 'Account List Applet - child'
Applet.
If MethodName = "CheckSR" Then
Dim oBO As BusObject
Dim oBC As BusComp
Dim strAccntId As String
With oBC
.SetViewMode AllView
.ClearToQuery
.SetSearchSpec "Account Id", strAccntId
.ExecuteQuery ForwardOnly
If .FirstRecord Then
'[additional code placed here]
Else
TheApplication.RaiseErrorText("No Service Requests Associated To This
Account.")
End If
End With
iRtn = CancelOperation
End If
BusComp_PreInvokeMethod = iRtn
End Function
Related Topic
NextRecord Method on page 222
FirstSelected Method
FirstSelected moves the focus to the first record of the multiple selection in the business component,
invoking any associated Basic events.
Syntax
BusComp.FirstSelected
Argument Description
Not applicable
Returns
An integer in Siebel VB: 1 or nonzero if there was a first record (the query returned results) and 0
if there are no records; a Boolean in ActiveX, COM, and Siebel eScript.
Used With
COM Data Server, Server Script
Examples
The following examples show how the FirstSelected method could be used in conjunction with the
NextSelected method to provide custom multirecord deletion functionality. This code could be
triggered in respect to the user invoking the Delete Selected custom method, when pressing a
custom button on an applet.
while (iRecord)
{
DeleteRecord();
iRecord = NextSelected();
}
return (CancelOperation);
}
return (ContinueOperation);
}
iRtn = ContinueOperation
If MethodName = "Delete Selected" Then
With me
Dim iRecord As Integer
iRecord = .FirstSelected
While iRecord
.DeleteRecord
iRecord = .NextSelected
Wend
End With
iRtn = CancelOperation
End If
BusComp_PreInvokeMethod = iRtn
End Function
GetAssocBusComp Method
GetAssocBusComp returns the association business component. The association business component
can be used to operate on the association using the normal business component mechanisms.
Syntax
BusComp.GetAssocBusComp
Argument Description
Not applicable
Returns
The association business component for a business component
Usage
This method and the Associate method make sense only for many-to-many relationships, which are
based on intersection tables, for example Account and Industry. In the context of a many-to-many
relationship, you can use Siebel VB to either add a new record (that is, associate a new child record),
or insert a record (that is, create a new record) in the child business component. To add a record,
use GetAssocBusComp and the Associate method. To insert a record, use GetMVGBusComp and the
NewRecord method. The GetAssocBusComp should be set to Nothing after use.
GetAssocBusComp can also be applied to the Child Business Component of a Master Detail View
(rather than upon the MVG BusComp) when a N:M Link is used and the Child Applet has an
Association Applet defined.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
The following example is in Siebel VB and uses GetAssocBusComp to add a new industry to an
account record:
Related Topics
GetMVGBusComp Method on page 203
GetPicklistBusComp Method on page 205
GetFieldValue Method
GetFieldValue returns the value for the field specified in its argument for the current record of the
business component. Use this method to access a field value.
Syntax
BusComp.GetFieldValue(FieldName)
Argument Description
Returns
A string containing the field value of the field identified in FieldName, an error message if the field
is inactive, or an empty string if the field is empty.
NOTE: Date fields retrieved by GetFieldValue() are always returned using the format MM/DD/YYYY,
no matter what your local date format is set to. Use GetFormattedFieldValue() to get the same date
format you use in the client interface.
Usage
Only fields that were active at the time of the BusComp query contain values. For more information,
read ActivateField Method on page 179. If this method is used on fields that are not active, an error
message is returned. If this method is used on fields that are empty, an empty string is returned.
CAUTION: If a value from a business component that is a child of the current business component
is desired, the Link Specification property for that field must be set to TRUE in Siebel Tools.
Otherwise, the parent business component cannot access the value in the child business component.
For more information, read Siebel Object Types Reference.
The FieldName must be enclosed in double quotes and must be spelled exactly as the field name
appears in Siebel Tools, with the correct case; for example,
GetFieldValue("ActivityCreatedByName")
The name "Person who created the activity", as shown in the status bar, does not work; nor does
the column head "Created By".
NOTE: In Browser Script, GetFieldValue can be used only for the fields exposed in the applet and for
the system Id field.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script
Example
The following example is in Siebel VB. It shows an implementation of the PreSetFieldValue event to
illustrate the use of GetFieldValue:
srowid = GetFieldValue("Id")
Set boBusObj = TheApplication.GetBusObject("Opportunity")
Set bcOppty = boBusObj.GetBusComp("Opportunity")
With bcOppty
.SetViewMode SalesRepView
.ActivateField "Sales Stage"
.SetSearchSpec "Id", srowid
.ExecuteQuery ForwardOnly
End With
End Function
with (bcOppty)
{
SetViewMode(SalesRepView);
ActivateField("Sales Stage");
SetSearchSpec("Id", srowid);
ExecuteQuery(ForwardOnly);
}
bcOppty = null;
boBusObj = null;
}
Related Topics
ActivateField Method on page 179
GetFormattedFieldValue Method
GetFormattedFieldValue Method
GetFormattedFieldValue returns the field value in the current local format; it returns values in the
same format as the Siebel UI.
Syntax
BusComp.GetFormattedFieldValue(FieldName)
Argument Description
FieldName String variable or literal containing the name of the field to obtain the value
from
Returns
A string containing the value of the requested field, in the same format as displayed in the user
interface, or an empty string ("") if the field is inactive or empty.
Usage
GetFormattedFieldValue is useful for code that is used in multiple countries with different formats for
currency, date, and number. This method can be used only on fields that have been activated using
ActivateField.
DTYPE_PHONE. When used on fields of DTYPE_PHONE, these methods return formatted phone
numbers.
Example 1:
Result:
Example 2:
Result:
DTYPE_DATE. When used on fields of DTYPE_DATE, these methods are the same as GetFieldValue
and SetFieldValue, except that the result is in the format of the Regional Setting.
Table 33 shows the standard formats used by GetFieldValue and SetFieldValue to return data.
Dates mm/dd/yyyy
Times hh:nn:ss
If you attempt to use SetFieldValue and your Regional Setting format is different, you receive an
error like this:
Error: The value '31-Dec-99' can not be converted to a date time value.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script
Example
The following Siebel VB example demonstrates how to use the GetFormattedFieldValue function and
how to calculate the number of days between two dates.
Sub Button_Click
Dim DateDiff as Integer
Dim oBC as BusComp
Set oBC= me.BusComp
x = oBC.GetFormattedFieldValue("Start Date")
y = oBC.GetFormattedFieldValue("Done")
dx = DateValue(x)
dy = DateValue(y)
DateDiff = dy - dx
End Sub
Related Topics
ActivateField Method on page 179
GetFieldValue Method on page 197
SetFieldValue Method on page 230
SetFormattedFieldValue Method on page 232
GetLastErrCode Method
The GetLastErrCode method returns the most recent error code on the business component level.
Syntax
BusComp.GetLastErrCode
Argument Description
Not applicable
Returns
The last error code as a short integer. 0 indicates no error.
Usage
After execution of a method, the GetLastErrCode can be invoked to check if any error was returned
from the previous operation. The GetLastErrText method can be invoked to retrieve the text of the
error message. The text retrieved using GetLastErrText also includes a Siebel error number that can
be used to search Oracle MetaLink 3 for additional information about the error.
Used With
COM Data Control, Mobile Web Client Automation Server
GetLastErrText Method
The GetLastErrText method returns the last error text message on the business component level.
Syntax
BusComp.GetLastErrText
Argument Description
Not applicable
Returns
The most recent error text message as a String
Usage
After execution of a method, the GetLastErrCode can be invoked to check if any error was returned
from the previous operation. The GetLastErrText method can be invoked to retrieve the text of the
error message.
Used With
COM Data Control, Mobile Web Client Automation Server
Related Topic
GetLastErrCode Method
GetMultipleFieldValues Method
GetMultipleFieldValues returns values for the fields specified in the property set.
Syntax
BusComp.GetMultipleFieldValues(SiebelPropertySet fieldNames, SiebelPropertySet fieldValues)
Argument Description
fieldValues A property set containing a collection of properties representing the values for
the fields specified in the fieldNames argument
Returns
TRUE if success; FALSE if failure
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Related Topic
SetMultipleFieldValues Method on page 233
GetMVGBusComp Method
The GetMVGBusComp method returns the MVG business component associated with the business
component field specified by FieldName. This business component can be used to operate on the
multi-value group using the normal business component mechanisms.
Syntax
BusComp.GetMVGBusComp(FieldName)
Argument Description
FieldName Name of the field with a multi-value group attached, used to obtain the multi-
value group business component
Returns
The multi-value group business component of the current business component and identified field
Usage
A multi-value group is a set of detail records attached to the current record in the business
component that holds the corresponding multi-value field.
NOTE: In the context of a many-to-many relationship, you can use Siebel VB to either add a new
record, that is, associate a new child record, or insert a record, that is, create a new record in the
child business component. To add a record, use GetAssocBusComp and the Associate method. To
insert a record, use GetMVGBusComp and the NewRecord method.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
The following sample Siebel VB code using GetMVGBusComp inserts a new address to the Hong
Kong Flower Shop account record. For other examples, read ExecuteQuery Method on page 190 and
FirstSelected Method on page 194.
With AccntBC
.SetViewMode SalesRepView
.ClearToQuery
.SetSearchSpec "Name", "Hong Kong Flower Shop"
.ExecuteQuery
Set AddrBC = .GetMVGBusComp "Street Address"
End With
With AddrBC
.NewRecord NewAfter
.SetFieldValue "City", "Denver"
.WriteRecord
End With
Related Topics
FirstSelected Method on page 194
GetPicklistBusComp Method
GetNamedSearch Method
GetNamedSearch returns the named search specification specified by searchName.
Syntax
BusComp.GetNamedSearch(searchName)
Argument Description
searchName Name of the search specification that references the search string.
Returns
A string containing the value specified in the search specification identified in searchName
Usage
The search specification uses the same syntax as used in predefined queries.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Related Topics
GetSearchExpr Method on page 207
GetSearchSpec Method on page 208
SetNamedSearch Method on page 235
GetPicklistBusComp Method
GetPicklistBusComp returns the pick business component associated with the specified field in the
current business component.
Syntax
BusComp.GetPicklistBusComp(FieldName)
Argument Description
FieldName Name of the field with a picklist specified; used to obtain the pick business
component
Returns
The pick business component of the current business component and identified field. If there is no
picklist associated with that field, the function returns an error.
Usage
The returned pick business component can be used to operate on the picklist. The
GetPickListBusComp should be destroyed after use by using the Nothing function.
NOTE: When a record is picked on a constrained picklist using the GetPickListBusComp and Pick
methods, the constraint is active. Therefore, the retrieved picklist business component contains only
those records that fulfill the constraint.
2 Navigate in the picklist business component to the record you want to pick.
4 Use Set objBCPickList = Nothing to explicitly destroy the picklist business component
instance.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
The following example is in Siebel eScript:
}
oBCPick = null;
}
The following example is for Java Data Bean. It selects a product from a picklist.
. . .
catch (SiebelException e)
{
System.out.println("Error in Pick " + e.getErrorMessage());
}
Related Topics
FirstSelected Method on page 194
GetMVGBusComp Method on page 203
GetSearchExpr Method
GetSearchExpr returns the current search expression for the business component.
Syntax
BusComp.GetSearchExpr
Argument Description
Not applicable
Returns
A string containing the current search expression. An example of a returned search expression string
is "Revenue > 10000 AND Probability > .5".
Usage
GetSearchSpec retrieves the business component state, not the values. The business component
state does not change until the query is executed. Note that it may never change to the original value
if the user input is invalid.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script
Related Topics
GetNamedSearch Method on page 205
GetSearchSpec Method
SetSearchExpr Method on page 237
GetSearchSpec Method
GetSearchSpec returns the search specification for the field specified by the FieldName argument.
Syntax
BusComp.GetSearchSpec(FieldName)
Argument Description
FieldName Contains the name of the field from which to obtain the associated search
specification.
Returns
A string containing the search specification for the field identified in FieldName. An example of a
returned search specification string is "> 10000".
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script
Related Topics
GetNamedSearch Method on page 205
GetSearchExpr Method on page 207
GetSortSpec Method on page 209
SetSearchSpec Method on page 238
GetSortSpec Method
GetSortSpec returns the active sort specification of the object that has context.
Syntax
this.GetSortSpec();
Argument Description
Not applicable
Returns
Active sort specification of the object that has context
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Related Topics
GetSearchSpec Method on page 208
SetSortSpec Method on page 242
GetUserProperty Method
GetUserProperty returns the value of a named user property.
Syntax
BusComp.GetUserProperty(propertyName)
Argument Description
Returns
The user property
Usage
The value of a user property is set using SetUserProperty. The user properties act like instance
variables of a business component. The advantage of user properties is that they can be accessed
from anywhere in the code (even from other applications through COM) using GetUserProperty. An
instance variable, on the other hand, can be accessed only from within Siebel VB from the same
object on which the variable is declared.
The value of the property is reset every time you instantiate a new business component.
NOTE: GetUserProperty does not interact directly with user properties defined in Siebel Tools.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Related Topic
SetUserProperty Method on page 244
GetViewMode Method
GetViewMode returns the current visibility mode for the business component. This effects which
records are returned by queries according to the visibility rules. For more information, read
SetViewMode Method on page 245.
Syntax
BusComp.GetViewMode
Argument Description
Not applicable
Returns
An integer constant that identifies a visibility mode
Returns Description
mode Where mode is a Siebel ViewMode constant or its corresponding integer value. The
constants shown are defined in three environments. For details on each Siebel
ViewMode constant, read SetViewMode Method on page 245.
SalesRepView (0)
ManagerView (1)
PersonalView (2)
AllView (3)
OrganizationView (5)
GroupView (7)
CatalogView (8)
SubOrganizationView (9)
Usage
GetViewMode() returns NoneSetView mode until a business component is executed or has its view
mode set through SetViewMode(). The NoneSetViewMode value indicates that the business
component has not yet had any visibility rules applied to it. A business component that has just been
created through a call to GetBusComp() is in this state, so if a specific view mode is desired, it must
be explicitly set through SetViewMode(). Otherwise, the first time the business component is
executed, its view mode is set according to some internal rules.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Related Topic
SetViewMode Method on page 245
InvokeMethod Method
InvokeMethod calls the specialized method or user-created method named in the argument.
VB Syntax
BusComp.InvokeMethod methodName, methodArgs
Argument Description
methodName The name of the method. For more information on the available methods, read
InvokeMethod Methods for the Business Component Object on page 213.
eScript Syntax
BusComp.InvokeMethod(methodName, methArg1, methArg2, , methArgn);
Argument Description
Returns
A string containing the result of the method
Usage
Use InvokeMethod to call methods on a business component object that are not exposed directly
through the object interface.
Specialized methods are typically methods implemented in applet or business component classes
other than CSSFrame and CSSBusComp, respectively, that is, specialized classes.
NOTE: The InvokeMethod method should be used only with documented specialized methods. Oracle
does not support calling specialized methods with InvokeMethod, unless they are listed in this book.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
The following example is in Siebel VB:
(general) (declarations)
Option Explicit
Sub Button1_Click
Me.BusComp.InvokeMethod "Select All"
End Sub
Leave:
End Function
Methods that manipulate files are available for business components whose Class is CSSBCFile. The
methods can be accessed using COM Data Control, Java Data Bean, Mobile Web Client Automation
Server, and Server Script.
ClearLOVCache Method
This method clears the object manager list of values (LOV) cache, functioning similarly to the Clear
Cache button in the Administration - Data > List of Values view.
NOTE: ClearLOVCache clears only the object manager cache, not the session cache in the High
Interactivity client.
Syntax
BusComp.InvokeMethod(ClearLOVCache)
Argument Description
none
Returns
Not Applicable
Used With
This method is supported by BusComp.InvokeMethod() calls in Browser Script, COM Data Control,
COM Data Server, Java Data Bean, Mobile Web Client Automation Server, and Server Script.
Example
The following Siebel eScript example is for Server Script:
if (MethodName == "TestMethod") {
lov_bc.NewRecord(0);
lov_bc.SetFieldValue("Type", "ACCOUNT_STATUS");
lov_bc.SetFieldValue("Name", "Hello");
lov_bc.SetFieldValue("Value", "Hello");
lov_bc.SetFieldValue("Translate", "Y");
lov_bc.WriteRecord();
lov_bc.InvokeMethod("ClearLOVCache");
lov_bc = null;
lov_bo = null;
return (CancelOperation);
return(ContinueOperation);
CreateFile Method
To create a file in the Siebel file system from an external source, use the business component
CreateFile method. Before calling CreateFile, make sure that a new business component record has
been created using the NewRecord method for the business component.
Syntax
BusComp.InvokeMethod("CreateFile", SrcFilePath, KeyField, KeepLink)
Argument Description
SrcFilePath The fully qualified path of the file on the Siebel Server or Mobile Web Client.
KeyFieldName The name of the field in the business component that contains the File Name.
For example: AccntFileName field in the Account Attachment business
component.
KeepLink Applies to URLs. Either Y or N depending on whether a link to the file is stored
as an attachment instead of the actual file.
Returns
A string containing the values of Success or Error depending on whether or not the operation
succeeded.
Used With
This method is supported by BusComp.InvokeMethod() calls in COM Data Control, COM Data Server,
Java Data Bean, Mobile Web Client Automation Server, and Server Script.
GenerateProposal Method
GenerateProposal creates a new proposal record. The DocServer handles the work of generating the
actual proposal.
Syntax
To specify a template:
BusComp.InvokeMethod("GenerateProposal", RecordExists, Replace, TemplateFile);
Argument Description
RecordExists If FALSE, then a new record is created and used to create a new proposal.
Replace If TRUE, the template file is copied from the template into the proposal (as a
draft file). You should typically call this method with this argument set to FALSE.
TemplateFile (Optional)
The default value of this argument is NULL.
A string that specifies the name of the template to use. When a string is passed
into this argument, the proposal searches for the first template record whose
name contains the string passed rather than using the default template.
Used With
This method is supported by BusComp.InvokeMethod() calls in Browser Script, COM Data Control,
COM Data Server, Java Data Bean, Mobile Web Client Automation Server, and Server Script.
GetFile Method
Obtains a file from the Siebel file system and places that file on the local file system of the Siebel
Server or Mobile Client. Note that you must be properly positioned on the desired file attachment
record to get the file and have it placed on the local file systems temporary directory.
Syntax
BusComp.InvokeMethod(GetFile, KeyFieldName)
Argument Description
KeyFieldName The name of the field in the business component that contains the File Name.
For example: AccntFileName field in the Account Attachment business
component.
Returns
A string containing Success, <OutFilePath> if the operation succeeded. OutFilePath is the fully
qualified path of the file on the Client/Server machine in the users temp directory. The return value
is Error if the operation failed.
Used With
This method is supported by BusComp.InvokeMethod() calls in COM Data Control, COM Data Server,
Java Data Bean, Mobile Web Client Automation Server, and Server Script.
PutFile Method
Updates a file in the Siebel file system with a newer file. Note that you must be properly positioned
on the desired file attachment record to update the file in the file system.
Syntax
BusComp.InvokeMethod(PutFile, SrcFilePath, KeyFieldName)
Argument Description
SrcFilePath This is the fully qualified path of the file on the Siebel Server or Mobile Web
Client.
KeyFieldName This is the name of the field in the business component that contains the File
Name. For example: AccntFileName field in the Account Attachment business
component.
Returns
A string containing the values of Success or Error depending on whether or not the operation
succeeded.
Usage
After using PutFile to save a file attachment the updated attachment is not visible in the user
interface until you call the WriteRecord method. For more information about WriteRecord, read
WriteRecord Method on page 249.
Used With
This method is supported by BusComp.InvokeMethod() calls in COM Data Control, COM Data Server,
Java Data Bean, Mobile Web Client Automation Server, and Server Script.
RefreshBusComp Method
This method re-executes the current query for the business component and places the focus back
onto the record that was previously highlighted. The user sees that the data is refreshed but the
same record is still highlighted in the same position in the list applet as before the RefreshBusComp
method was invoked.
Syntax
BusComp.InvokeMethod(RefreshBusComp)
Argument Description
none
Returns
Not Applicable
Used With
This method is supported by BusComp.InvokeMethod() calls in Browser Script, COM Data Control,
COM Data Server, Java Data Bean, Mobile Web Client Automation Server, and Server Script.
NOTE: This method only works with business components that are derived from CSSBCBase.
RefreshRecord Method
This method refreshes the currently highlighted record, which triggers an update of the business
component fields in the client display and positions the cursor on the context record.
Syntax
retVal = BusComp.InvokeMethod(RefreshRecord)
Argument Description
none
Returns
Not Applicable
Used With
This method is supported by BusComp.InvokeMethod() calls in Browser Script, COM Data Control,
Java Data Bean, Mobile Web Client Automation Server, and Server Script.
NOTE: This method only works with business components that are derived from CSSBCBase.
SetAdminMode Method
This method is particularly useful if you need to replicate the behavior enforced by the Admin
property of the View object by disabling all visibility rules for the business component.
Syntax
BusComp.InvokeMethod(SetAdminMode, flag)
Argument Description
flag TRUE or FALSE. Flag to specify whether the business component should be
executed in Admin mode.
Returns
Not Applicable
Used With
This method is supported by BusComp.InvokeMethod() calls in COM Data Control, COM Data Server,
Java Data Bean, Mobile Web Client Automation Server, and Server Script.
LastRecord Method
LastRecord moves the record pointer to the last record in the business component.
Syntax
BusComp.LastRecord
Argument Description
Not applicable
Returns
An integer in Siebel VB; a Boolean in ActiveX, COM, Java Data Bean, Siebel eScript.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
The following example is for Mobile Web Client Automation Server. SiebelApplication is an
Application instance:
HourGlassStop
Status.Text = SiebelApplication.GetLastErrText
End Sub
Related Topics
FirstRecord Method on page 192
NextRecord Method on page 222
Name Method
The Name property contains the name of the business component.
Syntax
BusComp.Name()
Argument Description
Not applicable
Returns
A string containing the business component name
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script
Example
The following example is in Browser Script:
NewRecord Method
NewRecord adds a new record (row) to the business component.
Syntax
BusComp.NewRecord(whereIndicator)
Argument Description
whereIndicator Predefined constant or corresponding integer indicating where the new row
is added. This value should be one of the following:
0 (or NewBefore)
1 (or NewAfter)
2 (or NewBeforeCopy)
3 (or NewAfterCopy)
Returns
Not applicable
Usage
This new row becomes the current row, either before or after the previously current record,
depending on the value you selected for WhereIndicator.
You can use NewRecord to copy a record. To place the copy before the original record use the
following command.
Object.NewRecord NewBeforeCopy
To place the copy after the original record, use the following command.
Object.NewRecord NewAfterCopy
In certain cases, using the NewRecord method in a server script results in slow performance for this
method. There is no error message shown and the new record is created, but the response time is
not optimal. This is due to the expected behavior of the application when creating new records.
Before an application inserts a new record into the database, it must obtain the cursor for the record
set to position the new record in the record set. This requires the record set to be populated before
creating the new record. In the context of a script, a query must be run on the business component
before the NewRecord method is called. If the query is not explicitly run in the script, the application
will force a query to run to bring back the cursor. The application will normally run a full table query,
which results in the performance issue.
For more information on performance issues with the NewRecord method, see FAQ 2079 on Oracle
MetaLink 3.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
The following example is in Siebel VB:
NextRecord Method
NextRecord moves the record pointer to the next record in the business component, making that the
current record and invoking any associated script events.
Syntax
BusComp.NextRecord
Argument Description
Not applicable
Returns
An integer in Siebel VB; a Boolean in Siebel eScript and COM: 1 if the record pointer was moved to
the next record, 0 if the current record was already the last record.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
The following example is in Siebel eScript. For the equivalent Siebel VB example, read FirstRecord
Method on page 192.
var i = 0;
var isRecord;
with (this)
{
ClearToQuery();
SetSearchSpec("Name", "*");
ExecuteQuery(ForwardBackward);
isRecord = FirstRecord();
}
while (isRecord)
{
i++;
isRecord = BusComp.NextRecord();
}
Related Topic
FirstRecord Method on page 192
NextSelected Method
NextSelected moves the focus to the next record of the current multiple selection.
Syntax
BusComp.NextSelected
Argument Description
Not applicable
Returns
An integer: 1 if there is another record in the multiple selection, 0 otherwise.
Used With
Server Script
Example
For examples, read FirstSelected Method on page 194.
ParentBusComp Method
ParentBusComp returns the parent (master) business component when given the child (detail)
business component of a Link.
Syntax
BusComp.ParentBusComp
Argument Description
Not applicable
Returns
The parent business component of the Link
Usage
ParentBusComp allows you to write code in the child business component that accesses field values
and performs actions on the parent business component using the normal business component
mechanisms.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
The following example is in Siebel VB. For another example, read ExecuteQuery Method on
page 190.
Pick Method
The Pick method places the currently selected record in a picklist business component into the
appropriate fields of the parent business component.
NOTE: In Siebel Business Applications v.7.5.3 and later releases, Pick cannot be used to change the
record in a read-only picklist field.
Syntax
BusComp.Pick
Argument Description
Not applicable
Returns
Not applicable
Usage
Pick must be invoked on the picklists business component. When a record is picked on a constrained
picklist using the GetPickListBusComp and Pick methods, the constraint is active. Therefore, only
records that fulfill the constraint can be retrieved.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
This Siebel VB example sorts the values in the Sales Stage field:
Sub BusComp_NewRecord
Dim oBC as BusComp
set oBC = me.GetPickListBusComp("Sales Stage")
With oBC
.ActivateField "Sales Stage Order"
.ClearToQuery
.SetSortSpec "Sales Stage Order"
.ExecuteQuery ForwardOnly
if .FirstRecord then .Pick
End With
function BusComp_NewRecord ()
{
var oBC = this.GetPickListBusComp("Sales Stage");
with (oBC)
{
ActivateField("Sales Stage Order");
ClearToQuery();
SetSortSpec("Sales Stage Order");
ExecuteQuery(ForwardOnly);
if (FirstRecord())
Pick();
}
oBC = null;
}
Related Topic
GetPicklistBusComp Method on page 205
PreviousRecord Method
PreviousRecord moves to the previous record in the business component, invoking any associated
Basic events.
Syntax
BusComp.PreviousRecord
Argument Description
Not applicable
Returns
An integer in Siebel VB; a Boolean in Siebel eScript, COM, and ActiveX.
Usage
PreviousRecord may be used only on a business component that has been queried using the
FowardBackward CursorMode.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
The following example is for Mobile Web Client Automation Server. SiebelApplication is an
Application instance:
(general) (declarations)
Option Explicit
If errCode = 0 Then
FieldValue.Text = oBusComp.GetFieldValue(FieldName.Text, _
errCode)
End If
HourClassStop
Status.Text = SiebelApplication.GetLastErrText
End Sub
Related Topic
ExecuteQuery Method on page 190
RefineQuery Method
This method refines a query after the query has been executed.
Syntax
BusComp.RefineQuery
Argument Description
Not applicable
Returns
Not applicable
Usage
Unlike ClearToQuery, RefineQuery retains the existing query specification and allows you to add
search conditions based only on those fields that have not been set by previous search expressions.
RefineQuery may be most useful when used in conjunction with GetNamedSearch.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
The following Siebel VB code fragment shows how RefineQuery might be used:
me.RefineQuery
me.SetSearchSpec "Substatus", "Assigned"
me.ExecuteQuery
Related Topics
ClearToQuery Method on page 185
GetNamedSearch Method on page 205
Release Method
The Release() method enables the release of the business component and its resources on the Siebel
Server.
Syntax
BusComp.release()
Argument Description
Not applicable
Returns
Not applicable
Used With
Java Data Bean
Example
The following example is for Java Data Bean:
import com.siebel.data.*;
{
// create Siebel Data Bean
// login into Siebel Data Bean
// Create Siebel Bus Object.
// get the Bus Object from SiebelDataBean
// Create Siebel Bus Comp siebBusComp
// Get the business component using SiebelBusObject
// Use the bus. Component
// Be sure to release the business component and its resources on the server
side siebBusComp.release();
// release the resources occupied by Siebel Bus Object and Siebel Data Bean after
their use.
}
The following example logs in to a Siebel Server. It then instantiates a business object, a business
component, and a business service. Then, it releases them in reverse order.
import com.siebel.data.*;
import com.siebel.data.SiebelException;
public JDBReleaseDemo()
{
try
{
// logoff
m_dataBean.logoff();
System.out.println("Logged off the Siebel server ");
}
catch (SiebelException e)
{
System.out.println(e.getErrorMessage());
}
Related Topic
Logoff Method on page 148
SetFieldValue Method
SetFieldValue assigns the new value to the named field for the current row of the business
component.
Syntax
BusComp.SetFieldValue FieldName, FieldValue
Argument Description
FieldName String containing the name of the field to assign the value to
Returns
Not applicable
Usage
This method can be used only on fields that are active. For details, read ActivateField Method on
page 179. For applications in standard interactivity mode, write the record immediately after using
SetFieldValue by calling WriteRecord.
FieldName must be enclosed in double quotes, and must be spelled exactly as the field name appears
in Siebel Tools (not in the status line of the application or the column head), with the correct case;
for example,
FieldValue must not have a length that exceeds the defined length of the field. For example, passing
a 20 character string into a field that is defined as being 16 characters long results in the runtime
error Value too long for field 'xxxxx' (maximum size nnn). A good practice is to check the length of
the string against the length of the destination field before using SetFieldValue.
Do not use the SetFieldValue method on a field that has a pick list. Instead, use the following
procedure.
1 Use GetPicklistBusComp(...) to get a reference to the picklist business component for the Last
Name field.
2 Set the required SearchSpec on the pick list business component so that a single unique record
is returned.
NOTE: SetFieldValue cannot be used with calculated fields and cannot be used recursively.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script
Example
The following example is in Siebel VB:
Related Topics
ActivateField Method on page 179
SetFormattedFieldValue Method
Pick Method on page 224
GetPicklistBusComp Method on page 205
SetFormattedFieldValue Method
SetFormattedFieldValue assigns the new value to the named field for the current row of the business
component. SetFormattedFieldValue accepts the field value in the current local format.
Syntax
BusComp.SetFormattedFieldValue FieldName, FieldValue
Argument Description
FieldName String containing the name of the field to assign the value to.
Returns
Not applicable
Usage
This method is useful when you write code for a Siebel configuration that is used in multiple countries
with different currency, date, and number formats. This method can be used only on fields that have
been activated using ActivateField.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script
Example
This Siebel VB example is a fragment from a program designed to track the velocity of an opportunity
through its sales stages:
(general) (declarations)
Option Explicit
With SalesStageBC
.SetViewMode AllView
.ClearToQuery
.SetSearchSpec "Sales Cycle Stage", StagePrev
.ExecuteQuery ForwardOnly
.FirstRecord
StageId = .GetFieldValue("Id")
End With
'Instantiate stage BC
Set StageBC = OpportunityBO.GetBusComp("Opportunity Stage")
With StageBC
.SetViewMode AllView
.ClearToQuery
.SetSearchSpec "Sales Stage Id", StageId
.ExecuteQuery ForwardOnly
If (.FirstRecord = 0) Then
'Create a new stage record and write it out
.NewRecord 1
'Record Id for future use
OppStageId = .GetFieldValue("Id")
.SetFieldValue "Opportunity Id", OppId
.SetFieldValue "Sales Stage Id", StageId
.SetFieldValue "Sales Rep", SalesRep
.SetFormattedFieldValue "Entered Date", StageDatePrev
.SetFormattedFieldValue "Left Date", StageDate
Dx = DateValue (StageDatePrev)
Dy = DateValue (StageDate)
Diff = Dy - Dx
DiffStr = Str(Diff)
.SetFieldValue "Days In Stage", DiffStr
.WriteRecord
End If
End With
Related Topics
ActivateField Method on page 179
SetFieldValue Method on page 230
SetMultipleFieldValues Method
SetMultipleFieldValues assigns a new value to the fields specified in the property set for the current
row of the business component.
Syntax
BusComp.SetMultipleFieldValues oPropertySet
Argument Description
Returns
Not applicable
Usage
This method can be used only on fields that are active. The FieldName argument in the property must
be set exactly as the field name appears in Siebel Tools, with the correct case. For example, in
oPropertySet.SetProperty "Name","Acme"
NOTE: Do not use the SetMultipleFieldValues method on a field that has a pick list.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Examples
The following example is in Siebel eScript:
var bo = TheApplication().GetBusObject("Opportunity");
var bc = bo.GetBusComp("Opportunity");
var ps = TheApplication().NewPropertySet ;
with (ps)
{
SetProperty ("Name", "Call Center Opportunity");
SetProperty ("Account", "Marriott International");
SetProperty ("Sales Stage", "2-Qualified");
}
bc.ActivateMultipleFields(ps);
bc.NewRecord(NewBefore);
bc.SetMultipleFieldValues(ps) ;
bc.WriteRecord;
try
{
Sieb_dataBean = new SiebelDataBean();
...
Sieb_busObject = Sieb_dataBean.getBusObject("Account");
Sieb_busComp = Sieb_busObject.getBusComp("Account");
ps = Sieb_dataBean.newPropertySet();
with(ps)
{
setProperty("Name", "Frank Williams Inc");
setProperty("Location", "10 Main St");
setProperty("Account Status", "Active");
setProperty("Type", "Customer");
}
Sieb_busComp.activateField ("Name");
Sieb_busComp.activateField ("Location");
Sieb_busComp.activateField ("Account Status");
Sieb_busComp.activateField ("Type");
Sieb_busComp.newRecord(true);
Sieb_busComp.setMultipleFieldValues(ps);
Sieb_busComp.writeRecord();
}
catch (SiebelException e)
{
system.out.println("Error : " + e.getErrorMessage());
}
Related Topics
ActivateMultipleFields Method on page 181
GetMultipleFieldValues Method on page 203
SetNamedSearch Method
SetNamedSearch sets a named search specification on the business component. A named search
specification is identified by the searchName argument.
Syntax
BusComp.SetNamedSearch searchName, searchSpec
Argument Description
searchSpec String containing the search specification string corresponding to the name
Returns
Not applicable
Usage
A named search specification is a search criterion that is not cleared by the ClearToQuery; for
example, a predefined query or business component search specification.
A named search specification can be modified only programmatically; it cannot be modified through
the UI. This specification is applied in conjunction with the existing search specification. When set,
the named search specification is applied every time ExecuteQuery is called. ClearToQuery does not
clear the named search specification. To clear it, explicitly set the searchSpec argument to "". Note
that when a new instance of the BusComp is created, the named search specification is cleared.
The searchSpec argument assigned to SetNamedSearch is the same argument that is used after the
equal sign in a predefined query. The maximum length of a predefined query is 2000 characters. For
details on how to set up the search specification, read SetSearchExpr Method and SetSearchSpec
Method on page 238.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Examples
This example shows how to set a named search to a business component depending on the position
of the current user.
function BusComp_PreQuery ()
{
if (TheApplication().GetProfileAttr("Position") == "Siebel Administrator");
{
this.SetNamedSearch ("Candidates", "[Status] LIKE 'Candidate'")
}
return (ContinueOperation);
}
BusComp_PreQuery = ContinueOperation
End Function
Note that defining searches using the SetNamedSearch method does not create a PDQ entry, this is
a search specified in script only. To retrieve this search specification, use GetNamedSearch method.
GetProfileAttr is used in personalization to retrieve values of an attribute in a user profile.
Related Topics
GetNamedSearch Method on page 205
SetSearchSpec Method on page 238
SetSearchExpr Method
SetSearchExpr sets an entire search expression on the business component, rather than setting one
search specification for each field. Syntax is similar to that on the Predefined Queries screen.
Syntax
BusComp.SetSearchExpr searchSpec
Argument Description
Returns
Not applicable
Usage
Call this method after ClearToQuery and before ExecuteQuery. It is not necessary to use ActivateField
on a field that is used in SetSearchExpr.
The maximum length of a predefined query is 2000 characters. The argument assigned to
SetSearchExpr is the same as that used after the equal sign in a predefined query. For example, the
first line following is a search specification in a predefined query; the second is the equivalent search
specification used with the various interface methods. Note that Name is a field on the business
component and therefore must be enclosed in brackets, [ ].
If field values have search keywords such as NOT, AND, and OR, use two pairs of double quotes
around the field value. For example, if a field Sub-Status can have the string Not an Issue as a field
value, you would use the following VB syntax to avoid an SQL error:
substatus = GetFieldValue("Sub-Status")
searchst = "[Value] = """ & substatus & """""
BC.SetSearchExpr searchst
substatus = GetFieldValue("Sub-Status")
searchst = "[Value] = " & substatus
BC.SetSearchExpr searchst
Use both SetSearchExpr and SetSortSpec to build a query that includes both a search specification
and a sort specification. You cannot set a sort specification with SetSearchExpr by itself. Do not use
SetSearchExpr and SetSearchSpec together; they are mutually exclusive.
Any dates used with SetSearchExpr must use the format MM/DD/YYYY, regardless of the Regional
control panel settings of the server or client computer.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script
Example
The following example is in Siebel eScript:
var Ob = TheApplication().ActiveBusObject();
var BC = Ob.GetBusComp("Opportunity");
var Account = "Turston Steel";
var Oppty = "CAD/CAM implementation";
var searchst = "[Name] = '" + Oppty + "' AND [Account] = '" + Account + "'";
Related Topics
ClearToQuery Method on page 185
ExecuteQuery Method on page 190
SetSearchSpec Method on page 238
SetSortSpec Method on page 242
SetSearchSpec Method
SetSearchSpec sets the search specification for a particular field. This method must be called before
ExecuteQuery.
Syntax
BusComp.SetSearchSpec FieldName, searchSpec
Argument Description
FieldName String containing the name of the field on which to set the search specification.
Returns
Not applicable
Usage
To avoid an unpredicted compound search specification on a business component, it is recommended
to call ClearToQuery before calling SetSearchSpec. It is not necessary to use ActivateField on a field
that is used in SetSearchSpec.
If multiple calls are made to SetSearchSpec for a business component, then the multiple search
specifications are handled as follows:
If the existing search specification is on the same field as the new search specification, then the
new search specification replaces the existing search specification. For example:
If the existing search specification is not on the same field as the new search specification, then
the resultant search specification is a logical AND of the existing and the new search
specifications. For example:
WHERE Type <> 'Renewal' AND (Status<> 'Sold' AND Status <> 'Cancelled' AND Status
<> 'Renewed')
If the existing search specification includes one or more of the same fields as the new search
specification, then the new search specification on those common fields only replaces the existing
search specification on the common fields. For example, if:
is subsequently applied to the result of the previous example, then the following WHERE clause
results:
Only the search specification on Status is replaced in the compound WHERE clause.
If a search specification is set declaratively in Siebel Tools, and another search specification is
set with script using SetSearchSpec(), then the resultant search specification is a logical AND of
the existing Tools-created specification and the scripted specification. For example:
WHERE Type <> 'Renewal' AND (Status <> 'Sold' AND Status <> 'Cancelled')
NOTE: When an existing Tools-created search specification includes the same field as a
subsequent search specification set with SetSearchSpec(), the behavior is not like the
replacement behavior that results when both specifications are set by using SetSearchSpec().
CAUTION: Do not use SetSearchExpr and SetSearchSpec together because they are mutually
exclusive.
Using logical and comparison operators. Any search specification that can be created in the user
interface can be duplicated in Siebel VB or eScript. Both logical operators and comparison operators
may be used, provided that they are handled correctly. For example, in VB:
Using special characters. If the search specification contains any of the following characters.
it must be enclosed in quotes. This rule applies to operators that are part of the search expression
as well as text to search for. If the search expression contains quotes, those quotes must be doubled.
For example, in the preceding line of code, notice that the entire search specification is enclosed in
double quotes, whereas fields and values referred to within the specification each have single quotes.
If the search object includes a single double quote, that quote must be doubled; for example, if you
wanted to search for text containing:
"We must
so that the initial quote is doubled, and the string containing it is placed within single quotes, and
the entire expression, including the single quotes, is placed within double quotes.
If the search specification includes single quotes (including apostrophes), the expression must be
placed within single quotes, apostrophes must be doubled, and double quotes must be placed around
the entire string. Thus, for example, if you wanted to search for Phillies Cheese Steaks in the Name
field, you would have to enter the specification in VB as follows:
NOTE: eScript and Browser Script require backslashes instead of double quotes for marking special
characters. For example: SetSearchSpec("Comments", "\'\"We must\'"); and
SetSearchSpec("Name", "\'Phillie\'\'s Cheese Steaks\'");
Searching for text in non-text fields. If the search expression queries a field of any type other
than text, or if it is an expression other than a field-level query, text must be placed within quotes
if it contains any characters other than the following:
Retrieving all records. To retrieve all records efficiently, use ClearToQuery followed by
ExecuteQuery, without using SetSearchSpec.
Searching for a null field. To search for null fields, use the following form:
If your search specification requests an empty string, then the search returns every record. For
example:
Any dates used with SetSearchSpec must use the format MM/DD/YYYY, regardless of the Regional
control panel settings of the server or client computer.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
For Siebel VB examples, read FirstRecord Method on page 192, SetFormattedFieldValue Method on
page 232, and BusComp_PreQuery Event on page 260. For a Siebel eScript example, read
ClearToQuery Method on page 185.
Example
This Siebel VB code searches for a contact by name and then navigates to the record displayed in a
view:
(general) (declarations)
Option Explicit
Sub Button1_Click
Dim theCurrComp As BusComp
Dim TargetView As String
Dim TargetBusObj As String
Dim TargetBusComp As String
Dim NewBusObj As BusObject
Dim NewComp As BusComp
Dim RecId1 As String
Dim RecId2 As String
Dim RecId3 As String
End Sub
with (oAccntBC)
{
SetViewMode(SalesRepView);
ClearToQuery();
SetSearchSpec("Name", "Hong Kong Flower Shop");
ExecuteQuery();
oAddrBC = GetMVGBusComp("Street Address");
}
with (oAddrBC)
{
NewRecord(NewAfter);
SetFieldValue("City", "Denver");
WriteRecord();
}
oAddrBC = null;
oAccntBC = null;
oAccntBO = null;
Related Topics
ExecuteQuery Method on page 190
ClearToQuery Method on page 185
SetSearchExpr Method on page 237
SetSortSpec Method
SetSortSpec Method
SetSortSpec sets the sort specification for a query.
Syntax
BusComp.SetSortSpec sortSpec
Argument Description
Returns
Not applicable
Usage
SetSortSpec, if used, must be called after ClearToQuery and before ExecuteQuery. The sortSpec
argument is a string of the form:
"fieldName1,fieldName2,...(ASCENDING)"
or
"fieldName1,fieldName2,...(DESCENDING)"
The entire string must be placed in quotes. You can sort on various fields in different orders by
separating the field names and order specifications with commas, as in the example.
The argument assigned to SetSortSpec is the same used after the equal sign in a predefined query.
For example, the first line following is a sort specification in a predefined query; the second is the
equivalent sort specification used with the various interface methods. Note that Name is the name
of a business component field.
'Account'.Sort = "Name(ASCENDING)"
BC.SetSortSpec "Name(ASCENDING)"
Any dates used with SetSortSpec must use the format MM/DD/YYYY, regardless of the Regional
control panel settings of the server or client computer.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
This Siebel VB example sorts the Opportunity list first by Account in reverse order, then in
alphabetical order by Site. Note that the column names in the Opportunity list applet are not the
same as those in the underlying business component.
NOTE: This example merely demonstrates how to sort in ascending and descending order. In actual
practice you should not sort in both directions in a single sort specification, as it degrades
performance considerably.
With Me
.ActivateField("Account")
.ActivateField("Account Location")
.ClearToQuery
.SetSortSpec "Account(DESCENDING), Account Location(ASCENDING)"
.ExecuteQuery
End With
BusComp_PreQuery = ContinueOperation
End Function
Function BusComp_PreQuery
with (this)
{
ActivateField("Account");
ActivateField("Account Location");
ClearToQuery();
SetSortSpec("Account(DESCENDING), Account Location(ASCENDING)");
ExecuteQuery();
}
return (ContinueOperation);
Related Topics
GetSortSpec Method on page 209
SetSearchExpr Method on page 237
SetSearchSpec Method on page 238
SetUserProperty Method
Sets the value of a named business component user property. The user properties are similar to
instance variables of a BusComp.
Syntax
BusComp.SetUserProperty propertyName, newValue
Argument Description
Returns
Not applicable
Usage
The advantage of user properties is that they can be accessed from anywhere in the code (including
from other applications through COM) using GetUserProperty. An instance variable, on the other
hand, can be accessed only from within Siebel VB from the same object on which the variable is
declared.
The value of the property is reset every time you instantiate a new business component.
NOTE: SetUserProperty does not interact directly with user properties defined in Siebel Tools.
Used With
COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server Script
Example
The following example is in Siebel VB:
Related Topic
GetUserProperty Method on page 209
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.
Siebel ViewMode constants correspond to applet visibility types. For more information about applet
visibility types, see Siebel Security Guide.
ManagerView 1 Displays records that the user and the users direct reports
have access to. Example: My Teams Accounts. Typically
used by managers.
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 on page 210
Example
The following example is in Siebel VB. For another example, see BusComp_PreDeleteRecord Event
on page 257.
(general) (declarations)
Option Explicit
Dim oBO as BusObject
Dim oBC as BusComp
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;
UndoRecord Method
UndoRecord reverses any uncommitted changes made to the record. This includes reversing
uncommitted modifications to fields, as well as deleting an active record that has not yet been
committed to the database.
Syntax
BusComp.UndoRecord
Argument Description
Not applicable
Returns
Not applicable
Usage
If you are using UndoRecord to delete a new record, it is useful only after NewRecord has been called
and before the new record has been committed. If you are using UndoRecord to reverse changes
made to field values, it is useful only before the changes have been committed through a call to
WriteRecord, or before the user has stepped off the record through the user interface. UndoRecord
reverses uncommitted changes to a record. Therefore, if you wish to have a fine degree of control
over which changes are reversed, place the code in the PreNewRecord, PreSetFieldValue, or
PreWriteRecord event, and issue a CancelOperation to cancel the change invoked by the particular
event.
Used With
COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Related Topic
NewRecord Method on page 221
WriteRecord Method
Commits to the database any changes made to the current record.
Syntax
oBusComp.WriteRecord
Argument Description
Not applicable
Returns
Not applicable
Usage
After creating new records and assigning values to fields, call WriteRecord to commit the new record
to the database.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script
Example
This Siebel VB example inserts an activity if the Sales Stage field is set to 02. For other examples,
see GetMVGBusComp Method on page 203 and NewRecord Method on page 221.
(general) (declarations)
Option Explicit
BusComp_Associate Event
The Associate event is called after a record is added to a business component to create an
association.
Syntax
BusComp_Associate
Argument Description
Not applicable
Returns
Not applicable
Usage
The semantics are the same as for BusComp_NewRecord.
Used With
Server Script
Related Topic
BusComp_NewRecord Event on page 255
BusComp_ChangeRecord Event
The ChangeRecord event is called after a record becomes the current row in the business component.
Syntax
BusComp_ChangeRecord
Argument Description
Not applicable
Returns
Not applicable
Usage
Code in the ChangeRecord event handler is executed each time that the focus changes to another
record. Avoid lengthy operations in this event handler to enable smooth scrolling in list applets.
Used With
Server Script
Example
This Siebel VB example uses two subprograms in the (general) (declarations) section to set up an
audit trail for service requests. The ChangeRecord event handler is used to initialize the values from
the service record so that they can be compared with current values.
(general) (declarations)
Option Explicit
Dim OldClosedDate, OldCreated, OldOwner, OldOwnerGroup
Dim OldSeverity, OldSource, OldStatus
Declare Sub CreateAuditRecord
Declare Sub InitializeOldValues
With ActionBC
.ActivateField "Activity SR Id"
.ActivateField "Description"
.ActivateField "Private"
.ActivateField "Service request id"
.ActivateField "Type"
.NewRecord NewAfter
Sub InitializeOldValues
OldClosedDate = GetFieldValue("Closed Date")
OldOwner = GetFieldValue("Owner")
OldSeverity = GetFieldValue("Severity")
If GetFieldValue("Severity") <> OldSeverity Then
NewValue = GetFieldValue("Severity")
ChangedText = "Changed Priority from " + OldSeverity + _
" to " + NewValue
CreateAuditRecord "Severity", NewValue, OldSeverity, _
ChangedText
End If
End Sub
Sub BusComp_ChangeRecord
InitializeOldValues
End Sub
BusComp_CopyRecord Event
The CopyRecord event is called after a row has been copied in the business component and that row
has been made active.
Syntax
BusComp_CopyRecord
Argument Description
Not applicable
Returns
Not applicable
Usage
BusComp_CopyRecord is called instead of BusComp_NewRecord when a new record is created:
Through any UI copy record mechanism (Edit > Copy Record; CTRL+B)
Used With
Server Script
BusComp_DeleteRecord Event
The DeleteRecord event is called after a row is deleted. The current context is a different row (the
Fields of the just-deleted row are no longer available).
Syntax
BusComp_DeleteRecord
Argument Description
Not applicable
Usage
When a user reads and deletes an existing record or creates and undoes a new record, this invokes
DeleteRecord. This invocation causes any associated scripts to be executed.
Returns
Not applicable
Used With
Server Script
BusComp_InvokeMethod Event
The InvokeMethod event is called when the InvokeMethod method is called on a business component.
Syntax
BusComp_InvokeMethod(methodName)
Argument Description
methodName String containing the name of the method that was invoked
Returns
Not applicable
Usage
The InvokeMethod event is called when a specialized method is called on a business component, or
when the InvokeMethod method has been explicitly called on a business component.
Used With
Server Script
BusComp_NewRecord Event
The NewRecord event is called after a new row has been created in the business component and that
row has been made active. The event may be used to set up default values for Fields.
Syntax
BusComp_NewRecord
Argument Description
Not applicable
Returns
Not applicable
Usage
BusComp_NewRecord is called when a new record is created unless the new record was created:
Through any UI copy record mechanism (Edit > Copy Record; CTRL+B)
Used With
Server Script
Example
For an example, read Pick Method on page 224.
BusComp_PreAssociate Event
The PreAssociate event is called before a record is added to a business component to create an
association. The semantics are the same as for BusComp_PreNewRecord.
Syntax
BusComp_PreAssociate
Argument Description
Not applicable
Returns
ContinueOperation or CancelOperation
Usage
CancelOperation stops the execution of the underlying Siebel code associated with the event.
However, if there is code in the same script following CancelOperation, that code runs regardless of
the CancelOperation.
Used With
Server Script
BusComp_PreCopyRecord Event
The PreCopyRecord event is called before a new row is copied in the business component. The event
may be used to perform pre-copy validation.
Syntax
BusComp_PreNewRecord
Argument Description
Not applicable
Returns
ContinueOperation or CancelOperation
Usage
CancelOperation stops the execution of the underlying Siebel code associated with the event.
However, if there is code in the same script following CancelOperation, that code runs regardless of
the CancelOperation.
Used With
Server Script
BusComp_PreDeleteRecord Event
The PreDeleteRecord event is called before a row is deleted in the business component. The event
may be used to prevent the deletion or to perform any actions in which you need access to the record
that is to be deleted.
Syntax
BusComp_PreDeleteRecord
Argument Description
Not applicable
Returns
ContinueOperation or CancelOperation
Usage
This event is called after the user has confirmed the deletion of the record, but before the record is
deleted from the database.
CancelOperation stops the execution of the underlying Siebel code associated with the event.
However, if there is code in the same script following CancelOperation, that code runs regardless of
the CancelOperation.
Used With
Server Script
Example
This Siebel VB example prevents the deletion of an account that has associated opportunities:
(general) (declarations)
Option Explicit
sAcctRowId = me.GetFieldValue("Id")
set oBO = TheApplication.GetBusObject("Opportunity")
set oBC = oBO.GetBusComp("Opportunity")
With oBC
.SetViewMode AllView
.ClearToQuery
.SetSearchSpec "Account Id", sAcctRowId
.ExecuteQuery ForwardOnly
If (.FirstRecord = 1) Then
RaiseErrorText("Opportunities exist for the Account - _
Delete is not allowed")
End If
End With
BusComp_PreDeleteRecord = ContinueOperation
End Function
BusComp_PreGetFieldValue Event
The PreGetFieldValue event is called when the value of a business component field is accessed.
Syntax
BusComp_PreGetFieldValue(FieldName, FieldValue)
Argument Description
FieldName String containing the name of the field accessed
Returns
ContinueOperation or CancelOperation
Usage
PreGetFieldValue is called at least once for each user interface element that displays the BusComp
field value, and it may also be called as a result of other internal uses.
NOTE: PreGetFieldValue is called every time the user interface is updated to repaint fields on the
screen. Therefore, a script attached to this event runs very frequently, which may cause the
computer to appear to be unresponsive.
Even empty scripts are invoked by the framework and thus cause a performance impact. If you want
to remove an existing script from BusComp_PreInvokeMethod to improve performance, you must
inactivate the appropriate record using Siebel Tools.
CancelOperation stops the execution of the underlying Siebel code associated with the event.
However, if there is code in the same script following CancelOperation, that code runs regardless of
the CancelOperation.
Used With
Server Script
BusComp_PreInvokeMethod Event
The PreInvokeMethod event is called before a specialized method is invoked on the business
component.
Syntax
BusComp_PreInvokeMethod(methodName)
Argument Description
Returns
ContinueOperation or CancelOperation
Usage
The PreInvokeMethod event is called just before a specialized method is invoked on the business
component. Specialized methods are methods based on applet or business component classes other
than CSSFrame and CSSBusComp, respectively, that is, specialized classes.
CancelOperation stops the execution of the underlying Siebel code associated with the event.
However, if there is code in the same script following CancelOperation, that code runs regardless of
the CancelOperation.
Used With
Server Script
BusComp_PreNewRecord Event
The PreNewRecord event is called before a new row is created in the business component. The event
may be used to perform preinsert validation.
Syntax
BusComp_PreNewRecord
Argument Description
Not applicable
Returns
ContinueOperation or CancelOperation
Usage
CancelOperation stops the execution of the underlying Siebel code associated with the event.
However, if there is code in the same script following CancelOperation, that code runs regardless of
the CancelOperation.
Used With
Server Script
BusComp_PreQuery Event
The PreQuery event is called before query execution.
Syntax
BusComp_PreQuery
Argument Description
Not applicable
Returns
ContinueOperation or CancelOperation
Usage
This event may be used to modify the search criteria or to restrict the execution of certain queries.
CancelOperation stops the execution of the underlying Siebel code associated with the event.
However, if there is code in the same script following CancelOperation, that code runs regardless of
the CancelOperation.
Used With
Server Script
Example
The following example is in Siebel VB:
BusComp_PreSetFieldValue Event
The PreSetFieldValue event is called before a value is pushed down into the business component from
the user interface or through a call to SetFieldValue.
Syntax
BusComp_PreSetFieldValue(FieldName, FieldValue)
Argument Description
Returns
ContinueOperation or CancelOperation
Usage
The PreSetFieldValue event is called each time a field is to be changed or populated for a given
business component.
When using a picklist to populate multiple fields, PreSetFieldValue is fired for each field that is
populated. For example, you have an applet that you use to populate Last Name, First Name, and
Contact ID. Therefore, PreSetFieldValue fires three times, once for each field.
CancelOperation stops the execution of the underlying Siebel code associated with the event.
However, if there is code in the same script following CancelOperation, that code runs regardless of
the CancelOperation. In the preceding example, if your script returns CancelOperation for a field,
that field is not populated. However, PreSetFieldValue still fires for the other two fields populated by
the picklist.
NOTE: To prevent infinite recursions, if the PreSetFieldValue event is running it does not run again
for the same business component instance, even if used on a different field in the business
component.
Used With
Browser Script, Server Script
Example
This Siebel VB example uses the PreSetFieldValue event to check if a quote discount is greater than
20 percent, and to take appropriate action if it is. For other examples of BusComp_PreSetFieldValue,
read LoginId Method on page 147, and ExecuteQuery Method on page 190.
{
TheApplication().RaiseErrorText(msgtext);
}
else
{
return (ContinueOperation);
}
}
else
{
return (ContinueOperation);
}
}
BusComp_PreWriteRecord Event
The PreWriteRecord event is called before a row is written to the database. The event may perform
any final validation necessary before the actual save occurs.
Syntax
BusComp_PreWriteRecord
Argument Description
Not applicable
Returns
ContinueOperation or CancelOperation
Usage
CancelOperation stops the execution of the underlying Siebel code associated with the event.
However, if there is code in the same script following CancelOperation, that code runs regardless of
the CancelOperation.
The PreWriteRecord event triggers only if a field value was modified or inserted, or when a record is
deleted. When a record is deleted, PreWriteRecord is called to delete the implied join records to the
initial record.
When associating a multivalue group record (based on an M:M relationship) with the business
component that invokes the association, the PreWriteRecord and WriteRecord events execute. These
events execute even if no fields on the base or invoking business component are updated by the
association. The PreWriteRecord and WriteRecord events are executed to acknowledge the update to
the intersection table.
Used With
Server Script
Example
Function BusComp_PreWriteRecord As Integer
BusComp_PreWriteRecord = ContinueOperation
End Function
BusComp_Query Event
The Query event is called just after the query is complete and the rows have been retrieved, but
before the rows are actually displayed.
Syntax
BusComp_Query
Argument Description
Not applicable
Returns
Not applicable
Used With
Server Script
Example
In this Siebel VB example, important information is defined using the Action business component
with a special activity type. If the user starts an account query, the code checks whether important
information is available. If so, the information is displayed in a message box.
Sub BusComp_Query
leave:
End Sub
BusComp_SetFieldValue Event
The SetFieldValue event is called when a value is pushed down into the business component from
the user interface or through a call to SetFieldValue. This event is not triggered for any predefaulted
or calculated fields in Siebel Tools.
Syntax
BusComp_SetFieldValue(FieldName)
Argument Description
Returns
Not applicable
Used With
Server Script
Example
This Siebel VB example shows how to invoke methods on an existing business component when the
SetFieldValue event is triggered:
BusComp_WriteRecord Event
The WriteRecord event is called after a row is written out to the database.
The WriteRecord event triggers after the record has been committed to the database. Do not use
SetFieldValue in a WriteRecord event. If you need to use SetFieldValue, put it in a PreWriteRecord
event (explained in BusComp_PreWriteRecord Event on page 263).
Syntax
BusComp_WriteRecord
Argument Description
Not applicable
Returns
Not applicable
Usage
When associating a multi-value group record (based on an M:M relationship) with the business
component that invokes the association, the PreWriteRecord and WriteRecord events execute. These
events execute even if no fields on the base or invoking business component are updated by the
association. The PreWriteRecord and WriteRecord events are executed to acknowledge the update to
the intersection table.
Used With
Server Script
GetBusComp Method
The GetBusComp method returns the specified business component.
Syntax
oBusObj.GetBusComp (BusCompName)
Argument Description
BusCompName String containing the desired business component in the business object
Returns
The requested business component
Usage
BusCompName is case-sensitive, and must match in case the form of the name as it appears in Siebel
Tools. If an instance of BusCompName already exists, that instance is returned. The interpreter
instantiates and returns a new instance of a business component using BusCompName if one does
not already exist.
If you already have a BusComp but you want to create a new one (without getting any existing ones),
use GetBusObject() first. This creates a new BusComp() that is not the same as the one already
existing (for example in an applet). Then use the new business object to do a GetBusComp() to
create new business components. If you use the business object that already exists you pick up any
child business components that already exist, even if you use GetBusComp() to get them.
The Nothing function should be used to destroy the instantiated business component when it is no
longer necessary.
NOTE: In Browser Script, the GetBusComp() method can only access business components in the
current view; in Server Script, the GetBusComp() method can access every business component that
has been instantiated in the active business object.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Server Script
Examples
The following examples are in Siebel eScript:
var BO = TheApplication().GetBusObject("Account");
var ConBC = BO.GetBusComp("Contact");
GetLastErrCode Method
The GetLastErrCode method returns the last error code.
Syntax
oBusObj.GetLastErrCode
Argument Description
Not applicable
Returns
The last error code as a short integer; 0 indicates no error.
Usage
After execution of a method, the GetLastErrCode can be invoked to check if any error was returned
from the previous operation. The GetLastErrText method can be invoked to retrieve the text of the
error message.
Used With
COM Data Control, Mobile Web Client Automation Server
Related Topic
GetLastErrText Method on page 269
GetLastErrText Method
The GetLastErrText method returns the last error text.
Syntax
oBusObj.GetLastErrText
Argument Description
Not applicable
Returns
A string containing the last error text message.
Usage
After execution of a method, the GetLastErrCode can be invoked to check if any error was returned
from the previous operation. The GetLastErrText method can be invoked to retrieve the text of the
error message.
Used With
COM Data Control, Mobile Web Client Automation Server
Related Topic
GetLastErrCode Method on page 268
Name Method
The Name method returns the name of the business object.
Syntax
oBusObj.Name
Argument Description
Not applicable
Returns
A string containing the business object name
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script
Example
For an example, read Name Method on page 220.
Release Method
The Release()method enables the release of the Business Object and its resources on the Siebel
Server.
Syntax
oBusObj.release()
Argument Description
Not applicable
Returns
Not applicable
Used With
Java Data Bean
Example
The following example is for Java Data Bean:
import com.siebel.data.*;
{
...
...
...
...
busObj.release();
}
GetFirstProperty Method
GetFirstProperty Method
This method retrieves the name of the first property of a business service.
Syntax
oService.GetFirstProperty()
Argument Description
Not applicable
Returns
A string containing the name of the first property of the business service
Usage
This method retrieves the name of the first property, in order of definition, of a business service. Use
GetFirstProperty and GetNextProperty to retrieve the name of a property. You can then use the
retrieved name as an argument to GetProperty to retrieve the property value, or with SetProperty
to assign property values.
Used With
Browser Script, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Examples
This function returns the number of Property Sets that belong to the Business Service given in the
parameter.
function countPropSets(busService)
{
var propSetName = busService.GetFirstProperty();
var count = 0;
return count;
}
{
count++;
propSetName = busService.getNextProperty();
}
catch(SiebelException sExcept)
{
return 0;
}
return count;
}
Related Topics
GetNextProperty Method on page 273
GetProperty Method on page 275
SetProperty Method on page 280
GetNextProperty Method
When the name of the first property has been retrieved, this method retrieves the name of the next
property of a business service.
Syntax
oService.GetNextProperty()
Argument Description
Not applicable
Returns
A string containing the name of the next property of a business service, or a null string ("") if no
more properties exist.
Usage
After retrieving the name of the first property with GetFirstProperty, the GetNextProperty method
should be used in a loop, to be terminated when a null string ("") is returned. When property names
have been retrieved, they can be used as arguments to GetProperty to retrieve the property value,
or with SetProperty to assign property values.
Used With
Browser Script, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Examples
This function returns the number of Property Sets that belong to the Business Service given in
parameter.
function countPropSets(busService)
{
var propSetName = busService.GetFirstProperty();
var count = 0;
return count;
}
catch(SiebelException sExcept)
{
return 0;
}
return count;
}
Related Topics
GetFirstProperty Method on page 302
GetProperty Method
SetProperty Method on page 280
GetProperty Method
The GetProperty method returns the value of the property whose name is specified in its argument.
Syntax
oService.GetProperty(propName)
Argument Description
Returns
A string containing the value of the property indicated by propName or NULL if the property does not
exist.
Usage
You must know the name of a property to retrieve its value. To retrieve property names, use the
GetFirstProperty and GetNextProperty methods.
Used With
Browser Script, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Related Topics
GetFirstProperty Method on page 302
GetNextProperty Method on page 273
SetProperty Method on page 280
InvokeMethod Method
The InvokeMethod method calls a method on the business service. This can be a documented
specialized method or a user-created method.
eScript Syntax
oService.InvokeMethod(methodName, InputArguments, OutputArguments)
Siebel VB Syntax
oService.InvokeMethod methodName, InputArguments, OutputArguments
Argument Description
Argument Description
outputPropSet A property set containing the output arguments of the Property Set
Returns
Not applicable
Usage
Built-in business services work the same way as business component invoke methods. That is, you
can call specialized methods on the service that are not exposed directly through the object
interface.
Run-time business services can hold user-defined methods, which must be implemented in scripts
written in Siebel VB or Siebel eScript. The scripts must be written in these languages within Siebel
Tools; however, they can be called through external interfaces.
Although the InvokeMethod function does not return a value, the properties in the OutputArguments
property set may have been modified.
NOTE: The InvokeMethod method should be used only with documented specialized methods. Oracle
does not support calling specialized methods with InvokeMethod, unless they are listed in this book.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script, Web Client Automation Server
Related Topics
Service_InvokeMethod Event on page 281
Service_PreInvokeMethod Event on page 284
Name Method
The Name property contains the name of the service.
Syntax
oService.Name
Argument Description
Not applicable
Returns
A string containing the service name
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script, Web Client Automation Server
Example
The following example is in Browser Script:
PropertyExists Method
This method returns a Boolean value indicating whether a specified property exists.
Syntax
oService.PropertyExists(propName)
Argument Description
Returns
In Siebel VB, an integer (0 for false, 1 for true); in other interfaces, a Boolean
Usage
Because GetProperty returns a null string ("") for nonexistent properties, you should use
PropertyExists() in an if statement to determine whether a specific property has been set.
Used With
Browser Script, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Release Method
The Release method() enables the release of the Business Service and its resources on the Siebel
Server.
Syntax
oBusSvc.release()
Argument Description
not applicable
Returns
Not applicable
Used With
Java Data Bean
Example
The following example logs in to a Siebel Server. It then instantiates a business object, a business
component, and a business service. Then, it releases them in reverse order.
import com.siebel.data.*;
import com.siebel.data.SiebelException;
public JDBReleaseDemo()
{
try
{
// logoff
m_dataBean.logoff();
System.out.println("Logged off the Siebel server ");
}
catch (SiebelException e)
{
System.out.println(e.getErrorMessage());
}
RemoveProperty Method
This method removes a property from a business service.
Syntax
oService.RemoveProperty(propName)
Argument Description
Returns
Not applicable
Usage
This method removes the property propName from the business service oService. As a result,
subsequent calls to PropertyExists for that property returns FALSE.
Used With
Browser Script, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Related Topic
PropertyExists Method on page 277
SetProperty Method
This method assigns a value to a property of a business service.
Syntax
oService.SetProperty(propName, propValue)
Argument Description
propName A string indicating the name of the property whose value is to be set
propValue A string containing the value to assign to the property indicated by propName
Returns
Not applicable
Usage
SetProperty is used to set the value of a property of the business service from one of the methods
of the service or from an external object.
Used With
Browser Script, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server
Script
Example
For an example, read Service_PreInvokeMethod Event on page 284.
Related Topic
GetProperty Method on page 275
Service_InvokeMethod Event
Service_InvokeMethod Event
The InvokeMethod event is called after the InvokeMethod method is called on a business service.
Argument Description
Argument Description
Argument Description
NOTE: In Browser Script, output property sets are not supported for this
event.
Returns
Not applicable
Usage
Although this event does not return a value, in Server Script it can add properties to, or alter the
values of the properties in, the property set OutputArguments. In Browser Script it cannot add to,
store, or update the values of the properties in the output property set.
When you invoke business service methods through Browser Script, the business service can be
implemented as a browser-based business service (written in JavaScript) or a server-based business
service. Initially, the high interactivity mode framework checks if the business service resides in the
browser, and if it does not find it, it sends the request to the server for execution.
NOTE: Browser Script can invoke a browser-based or server-based business service, but Server
Script can only invoke a server-based business service.
NOTE: Although the InvokeMethod function does not return a value in Server Script, it can modify
the properties in the OutputArguments property set.
Used With
Browser Script, Server Script
Example
This eScript example invokes the Shipping Engine business service created in
Service_PreInvokeMethod Event on page 284 in response to a button click. The InvokeMethod
property on the button is set to CalcShipping. It gets values from the Order Entry - Test business
component, passes a property set to the service, gets return values by means of another property
set, and then passes these values back to the Order Entry - Test business component.
{
if (MethodName == "CalcShipping") {
with (oBusComp) {
if (FirstRecord())
{
var size = GetFieldValue(Total Volume);
var shipper = GetFieldValue("Ship Via Id");
var shipMethod = GetFieldValue("Carrier Type");
var weight = GetFieldValue("Total Weight");
}
with (Inputs) {
return (CancelOperation);
else
return (ContinueOperation);
Related Topic
Service_PreInvokeMethod Event on page 284
Service_PreCanInvokeMethod Event
The PreCanInvokeMethod event is called before the PreInvokeMethod, allowing the developer to
determine whether or not the user has the authority to invoke the business service method.
Argument Description
&CanInvoke A string representing whether or not the business service method can be
invoked. Valid values are TRUE and FALSE.
Argument Description
Returns
CancelOperation or ContinueOperation
Used With
Browser Script, Server Script
Service_PreInvokeMethod Event
The PreInvokeMethod event is called before a specialized method on the business service is invoked.
Argument Description
Argument Description
NOTE: In Browser Script, output property sets are not supported for this
event.
Returns
ContinueOperation or CancelOperation
Usage
If implementing a new method, or overriding the behavior of a method implemented in a specialized
business service, the script should return CancelOperation to avoid invoking an Unknown method
name error. As Figure 8 illustrates, this error is predictable if the PreInvokeMethod event is scripted.
This occurs because there is no native code to execute in the InvokeMethod event. CancelOperation
tells the Siebel application to cancel the remaining operations associated with the event.
NOTE: The example in Figure 8 applies only to new and user-defined methods. For existing standard
Siebel methods, it is not necessary to use CancelOperation.
Service_InvokeMethod is rarely scripted, but can be used for such post-operation events as posting
a notice to a log when the event completes successfully.
Used With
Browser Script, Server Script
Example
This Siebel VB example creates the new service Shipping Engine:
iReturn = ContinueOperation
sShipper = Inputs.GetProperty("Shipping Company")
sShipMethod = Inputs.GetProperty("Ship Method")
dWeight = Val(Inputs.GetProperty("Weight"))
dSize = Val(Inputs.GetProperty("Volume"))
iZone = Val(Inputs.GetProperty("Zone"))
DelDate = DateValue(Now)
Case "Airline"
Select Case sShipMethod
Case "Next-Day Air"
dCost = 5 + (dWeight * .3) + (dSize * .33) + _
(Val(sZone) * .5)
DelDate = DelDate + 1
Case "Second-Day Air"
dCost = 4 + (dWeight * .3) + (dSize * .2) + _
(Val(sZone) * .3)
DelDate = DelDate + 2
Case "Ground"
dCost = 3 + (dWeight * .18) + (dSize * .1) + _
(Val(sZone) * .1)
DelDate = DelDate + 2 + Int(Val(sZone) * .8)
End Select
End Select
End If
Service_PreInvokeMethod = iReturn
End Function
Related Topic
Service_InvokeMethod Event on page 281
Control Methods
In the method descriptions, the placeholder controlVar stands for the name of the control on which
the method is invoked; for example, Button1_Click.
Applet Method
The Applet method returns the parent applet object for a control.
Syntax
controlVar.Applet
Argument Description
Not applicable
Returns
The parent applet of the control
Usage
Obtaining the parent applet allows you to perform operations on the applet object, not just the
control.
Used With
Browser Script
BusComp Method
The BusComp method returns the corresponding business component for the control.
Syntax
controlVar.BusComp
Argument Description
Not applicable
Returns
The business component associated with the controls parent applet.
Used With
Browser Script
GetProperty Method
The GetProperty method returns the value of the property of a control.
Syntax
controlVar.GetProperty(propName)
Argument Description
Returns
The value of the property of a control.
Usage
GetProperty can be used with the following controls: CheckBox, ComboBox, TextBox, TextArea, and
Label.
Use GetProperty to call the following properties: Background Color, Enabled, FontType, FontColor,
FontSize, FontStyle, Height, Width, Shown, Read Only, Visible.
If more than one property is to be retrieved, each must be retrieved in a separate statement.
Used With
Browser Script
Example
This code sample uses GetProperty to return values for FontSize, Background Color, Width, and
Height:
theApplication().SWEAlert("checkbox.FontSize : " +
objCheckBox.GetProperty("FontSize"));
theApplication().SWEAlert("checkbox.BgColor : " +
objCheckBox.GetProperty("BgColor"));
theApplication().SWEAlert("checkbox.Width : " + objCheckBox.GetProperty("Width"));
theApplication().SWEAlert("checkbox.Height : " +
objCheckBox.GetProperty("Height"));
GetValue Method
The GetValue method returns the value of the control. The type of the return value depends on the
specific control object.
Syntax
controlVar.GetValue
Argument Description
Not applicable
Returns
The value displayed by the control for the data type of the underlying field.
NOTE: GetValue cannot return a literal value input into a control by a user. The method instead
returns the value that the users entry has been stored as, based on the data type of the underlying
field.
Usage
The GetValue and SetValue methods work only for controls that are associated with business
component fields. Therefore, these methods are not applicable to labels.
Used With
Browser Script
Name Method
The Name method returns the name of the object.
Syntax
controlVar.Name
Argument Description
Not applicable
Returns
A string containing the object name
Used With
Browser Script
Example
For an example, read Name Method on page 220.
SetLabelProperty Method
The SetLabelProperty method sets visual properties of a label.
Syntax
controlVar.SetLabelProperty(propName, propValue)
Argument Description
propName The name of the property to be set, as described in the following table
propValue The value to assign to the property, as described in the following table
Returns
Not applicable
Usage
If more than one property is to be set, each must be set in a separate statement.
The following table lists the properties that can be set for a label, and the values that can be assigned
to them:
BgColor string Determines Background Color for a label; for example, red is
ff0000, green is 00ff00, and blue is 0000ff
FontColor string Determines FontColor for a label; for example, green is 00ff00
FontType string Determines FontType for a label; for example, Times Roman
FontWeight string Determines FontWeight for a label. Acceptable values are bold,
bolder, lighter, normal, 100, 200, 300, 400 (equivalent to normal),
500, 600, 700 (equivalent to bold), 800, and 900. Default is normal.
The SetLabelProperty method is not enabled by default. You must enable it in Siebel Tools before
using it in a script. To enable the SetLabelProperty, expand the Control node in the Tools Object
Explorer and select the Control User Prop node. Then add a new Control User Prop named
useLabelID with a value of TRUE.
Used With
Browser Script
Example
The following code shows the use of SetLabelProperty:
ctl.SetLabelProperty("BgColor", bgColor);
return ("CancelOperation");
}
SetProperty Method
The SetProperty method sets visual properties of a control.
Syntax
controlVar.SetProperty(propName, propValue)
Argument Description
propName The name of the property to be set, as described in the following table
propValue The value to assign to the property, as described in the following table
Returns
Not applicable
Usage
SetProperty can be used with the following controls: CheckBox, ComboBox, TextBox, and TextArea.
If more than one property is to be set, each must be set in a separate statement.
The following table lists the properties that can be set for a control, and the values that can be
assigned to them:
BgColor string Determines Background Color for a control; for example, red is
ff0000, green is 00ff00, and blue is 0000ff
Enabled TRUE or FALSE Is the button active? (Unless explicitly modified by using
SetProperty, default is TRUE.)
FontColor string Determines FontColor for a control; for example, green is 00ff00
FontType string Determines FontType for a control; for example, Times Roman
Shown TRUE or FALSE Is the control shown? (Unless explicitly modified by using
SetProperty, default is as defined in the repository.)
ReadOnly TRUE or FALSE Determines whether the control is read-only. Defaults to repository
definition unless explicitly modified by using SetProperty.
Visible TRUE or FALSE Determines whether the control is visible. Defaults to repository
definition unless explicitly modified by using SetProperty.
Used With
Browser Script
Example
The following code shows the use of SetProperty:
objCheckBox.SetProperty("FontColor", "00ff00");
objCheckBox.SetProperty("FontStyle", "italic");
objCheckBox.SetProperty("FontType", "Verdana");
objCheckBox.SetProperty("FontSize", "25pt");
objCheckBox.SetProperty("BgColor", "00f000");
objCheckBox.SetProperty("Width", "100");
objCheckBox.SetProperty("Height", "100");
SetValue Method
The SetValue method sets the contents of the specified control to the value indicated.
Syntax
controlVar.SetValue (controlValue)
Argument Description
Returns
Not applicable
Usage
The GetValue and SetValue methods work only for controls that are associated with business
component fields. Therefore, these methods are not applicable to labels. SetValue sets the contents
of a control. The user can still change those contents before they are committed to the BusComp
field.
SetValue does not validate the format of the data. Data validation occurs at the time user commits
the record by stepping off the field/record or saving the record. SetValue can also set the value for
a read-only control. However, such value is lost when the record is committed. Also, these methods
only work on form applets.
Used With
Browser Script
Example
The following code shows the use of GetValue and SetValue:
AddChild Method
The AddChild method is used to add subsidiary property sets to a property set, so as to form
hierarchical (tree-structured) data structures.
Syntax
oPropSet.AddChild(childPropSet as PropertySet)
Argument Description
childObject A property set to be made subsidiary to the property set indicated by oPropSet
Returns
An integer indicating the index of the child property set.
Usage
Property sets can be used to create tree-structured data structures. Any number of arbitrarily
structured child property sets can be added to a property set. You may use child property sets to
structure a property set in a manner similar to the data model. For example, the parent property set
might be Account, with child property sets for opportunities, contacts, activities, and so on. At the
same time, you could construct an independent property set called Opportunity, to which accounts,
contacts, and activities might be children.
If a property set is instantiated within script and then added to a parent property set, the child
property set is not released when the parent property set is released. This is because a reference to
the child property set still exists independently.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script, Web Client Automation Server
Example
The following fragment of eScript code shows how child property sets may be added to a parent
property set:
Account.AddChild(Opportunity);
Account.AddChild(Contact);
Account.AddChild(Activity);
Related Topics
GetChild Method on page 300
InsertChildAt Method on page 308
RemoveChild Method on page 309
Copy Method
This method returns a copy of a property set.
Syntax
oPropSet.Copy()
Argument Description
Not applicable
Returns
A copy of the property set indicated by oPropSet
Usage
This method creates a copy of a property set, including any properties and children it may have.
Because property sets are generally passed by reference, making a copy allows the method to
manipulate the property set without affecting the original definition.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script, Web Client Automation Server
Example
This Siebel VB example uses a copy of a property set to store the original values of its properties,
and displays both the original and Pig-Latin forms of the properties:
(general) (declarations)
Option Explicit
(Sub ClickMe_Click)
propName = Outputs.GetFirstProperty()
do while propName <> ""
propVal = Outputs.GetProperty(propName)
newPropVal = PigLatin(propVal)
Outputs.SetProperty propName, newPropVal
message = message & propVal & " has become " & _
newPropVal & Chr$(13)
propName = Outputs.GetNextProperty()
loop
TheApplication.RaiseErrorText message
End Sub
GetByteValue Method
This method returns a byte array if a byte value has been set.
Syntax
oPropSet.getByteValue()
Argument Description
Not applicable
Returns
A byte array if a byte value has been set, null if a string value has been set.
Used With
Java Data Bean
Example
The following example takes a binary value and outputs binary.
// XML to send
String str="<?xml version=\"1.0\" encoding=\"UTF8\"
?><GetCommunicationDataInput><MemberID>20048963</MemberID></
GetCommunicationDataInput>";
input.setByteValue(bvalue);
businessService.invokeMethod("RunProcess",input,output);
Related Topic
SetByteValue Method on page 311
GetChild Method
This method returns a specified child property set of a property set.
Syntax
oPropSet.GetChild(index)
Argument Description
index An integer representing the index number of the child property set to be retrieved
Returns
The property set at index index of the parent property set
Usage
When child property sets are created, each is given an index number within the parent property set,
starting at 0. Property sets added using AddChild get the next available index number. However, a
property set added using InsertChildAt inserts a new property set at a specified index. The property
set previously at that index, and every property set after it, have their indexes increased by 1.
Similarly, a property set removed using RemoveChild decreases the indexes of following child
property sets by 1.
NOTE: This method returns the number of direct descendants only. That is, if the child property sets
have children of their own, these grandchildren are not included in the computation of the return
value.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script, Web Client Automation Server
NOTE: When using the Web Client Automation Server, the child object retrieved is a copy of the
actual object. Any update to the object retrieved will not update the originating object.
Example
This Siebel eScript example sets the Name property of child property sets to the same value:
function Test1_Click ()
{
var Account = TheApplication().NewPropertySet();
var Opportunity = TheApplication().NewPropertySet();
var Contact = TheApplication().NewPropertySet();
var Activity = TheApplication().NewPropertySet();
var j;
Account.AddChild(Opportunity);
Account.AddChild(Contact);
Account.AddChild(Activity);
Related Topics
AddChild Method on page 297
InsertChildAt Method on page 308
GetChildCount Method
This method returns the number of child property sets attached to a parent property set.
Syntax
oPropSet.GetChildCount()
Argument Description
Not applicable
Returns
The number of child property sets subordinate to oPropSet
Usage
This method returns the actual number of child property sets of oPropSet. Because index numbers
for child property sets start at 0, a child count of 3 indicates that there are child property sets at
indexes 0, 1, and 2.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script, Web Client Automation Server
Example
For an example, read GetChild Method on page 300.
GetFirstProperty Method
This method returns the name of the first property in a property set.
Syntax
oPropSet.GetFirstProperty()
Argument Description
Not applicable
Returns
A string representing the name of the first property in a property set
Usage
GetFirstProperty() retrieves the name of the first property, in order of definition, of a business
service. Use GetFirstProperty and GetNextProperty to retrieve the name of a property. You can then
use the retrieved name as an argument to GetProperty to retrieve the property value, or with
SetProperty to assign property values.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script, Web Client Automation Server
Example
This example uses GetFirstProperty to get the first property, then retrieves all subsequent properties
using GetNextProperty. The loop terminates when GetNextProperty retrieves a null.
propName = Inputs.GetFirstProperty();
propName = Inputs.GetNextProperty();
}
return (CancelOperation);
}
Related Topics
GetNextProperty Method
GetProperty Method on page 305
GetLastErrCode Method
The GetLastErrCode method returns the most recent error code.
Syntax
oPropSet.GetLastErrCode
Argument Description
Not applicable
Returns
The last error code as a short integer; 0 indicates no error.
Usage
After execution of a method, the GetLastErrCode can be invoked to check if any error was returned
from the previous operation. The GetLastErrText method can be invoked to retrieve the text of the
error message.
Used With
Mobile Web Client Automation Server, Web Client Automation Server
Related Topic
GetLastErrText Method
GetLastErrText Method
The GetLastErrText method returns the last error text message.
Syntax
oPropSet.GetLastErrText
Argument Description
Not applicable
Returns
The most recent error text message as a string
Usage
After execution of a method, the GetLastErrCode can be invoked to check if any error was returned
from the previous operation. The GetLastErrText method can be invoked to retrieve the text of the
error message.
Used With
Mobile Web Client Automation Server, Web Client Automation Server
Related Topic
GetLastErrCode Method on page 303
GetNextProperty Method
This method returns the next property in a property set.
Syntax
oPropSet.GetNextProperty()
Argument Description
Not applicable
Returns
A string representing the name of the next property in a property set
Usage
After retrieving the name of the first property with the GetFirstProperty method, GetNextProperty
should be used in a loop, to be terminated when a null string ("") is returned. When property names
have been retrieved, they may be used as arguments to GetProperty to retrieve the property value,
or with SetProperty to assign property values.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script, Web Client Automation Server
Example
For an example, read GetFirstProperty Method on page 302.
Related Topics
GetFirstProperty Method on page 302
GetProperty Method
GetProperty Method
This method returns the value of a property when given the property name.
Syntax
oPropSet.GetProperty(propName)
Argument Description
Returns
A string representing the value stored in the property indicated by propName, or an empty string
("") if the property does not exist
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script, Web Client Automation Server
Example
The following fragment of Siebel eScript code receives a set of input properties used with the
Shipping Engine service described in Service_PreInvokeMethod Event on page 284:
Related Topics
GetFirstProperty Method on page 302
GetNextProperty Method on page 305
SetProperty Method on page 312
GetPropertyCount Method
This method returns the number of properties attached to a property set.
Syntax
oPropSet.GetPropertyCount
Argument Description
Not applicable
Returns
The number of properties contained within a property set
Used With
Browser Script, COM Data Control, COM Data Server, Mobile Web Client Automation Server, Server
Script, Web Client Automation Server
GetType Method
This method retrieves the data value stored in the type attribute of a property set.
Syntax
oPropSet.GetType
Argument Description
Not applicable
Returns
A string representing the value stored in the type attribute of the property set
Usage
Type, like value, is a special storage location for a data value.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script, Web Client Automation Server
Related Topics
GetValue Method
SetType Method on page 313
GetValue Method
This method retrieves the data value stored in the value attribute of a property set.
Syntax
oPropSet.GetValue
Argument Description
Not applicable
Returns
A string representing the data value stored in the value attribute of a property set
Usage
Value, like type, is a special storage location for a data value.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script, Web Client Automation Server
Related Topics
GetProperty Method on page 305
GetType Method on page 307
SetValue Method on page 314
InsertChildAt Method
This method inserts a child property set into a parent property set at a specific location.
Syntax
oPropSet.InsertChildAt childObject, index
Argument Description
childObject A property set to be made subsidiary to the property set indicated by oPropSet
Returns
Not applicable
Usage
This method inserts the property set childObject at the location index. Index numbers start at 0.
When a child property set is inserted, the property set previously at the location index has its index
increased by 1, as do subsequent child property sets.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script, Web Client Automation Server
Related Topic
AddChild Method on page 297
PropertyExists Method
This method returns a Boolean value indicating whether a specified property exists in a property set.
Syntax
oPropSet.PropertyExists(propName)
Argument Description
Returns
In Siebel VB, an integer (0 for false, 1 for true); in other interfaces, a Boolean
Usage
Because GetProperty returns a null string ("") for every nonexistent property, use PropertyExists()
in an if statement to determine whether a specific property has been set.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script, Web Client Automation Server
Example
For an example, read GetFirstProperty Method on page 302.
RemoveChild Method
This method removes a child property set from a parent property set.
Syntax
oPropSet.RemoveChild index
Argument Description
index An integer representing the index number of the child property set to be removed
Returns
Not applicable
Usage
When a child property set is removed, every child property set with an index higher than that of the
removed set has its index decremented by 1.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script, Web Client Automation Server
Example
The following Siebel VB code fragment removes every child property set of a property set:
Dim i As Integer
for i = 0 to outputs.GetChildCount()
outputs.RemoveChild(0)
Next i
Related Topics
AddChild Method on page 297
InsertChildAt Method on page 308
RemoveProperty Method
This method removes a property from a property set.
Syntax
oPropSet.RemoveProperty propName
Argument Description
Returns
Not applicable
Usage
This method removes the property propName from the property set oPropSet.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script, Web Client Automation Server
Reset Method
This method removes every properties and child property set from a property set.
Syntax
oPropSet.Reset()
Argument Description
Not applicable
Returns
Not applicable
Usage
This method removes every property and children from a property set, allowing the property set to
be reused with new properties.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script, Web Client Automation Server
SetByteValue Method
This method sets the value portion of a property set.
Syntax
oPropSet.setByteValue(value)
Argument Description
Returns
Not applicable
Used With
Java Data Bean
Example
The following example takes a binary value and outputs binary.
// XML to send
String str="<?xml version=\"1.0\" encoding=\"UTF8\"
?><GetCommunicationDataInput><MemberID>20048963</MemberID></
GetCommunicationDataInput>";
input.setByteValue(bvalue);
businessService.invokeMethod("RunProcess",input,output);
Related Topic
GetByteValue Method on page 299
SetProperty Method
This method assigns a data value to a property in a property set.
Syntax
oPropSet.SetProperty propName, propValue
Argument Description
Returns
Not applicable
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script, Web Client Automation Server
Example
This Siebel VB fragment makes use of the business service Shipping Engine, which is illustrated in
Service_PreInvokeMethod Event on page 284:
With Inputs
.SetProperty "Shipping Company", "Airline"
.SetProperty "Weight", "12"
.SetProperty "Total Dimensions", "48"
.SetProperty "Shipping Method", "Second-Day Air"
End With
Related Topic
GetProperty Method on page 305
SetType Method
This method assigns a data value to the type attribute of a property set.
Syntax
oPropSet.SetType type
Argument Description
Returns
Not applicable
Usage
Type, like value, is a special storage location for a data value.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script, Web Client Automation Server
Related Topics
GetType Method on page 307
SetValue Method on page 314
SetValue Method
This method assigns a data value to the value attribute of a property set.
Syntax
oPropSet.SetValue value
Argument Description
Returns
Not applicable
Usage
Values, like properties and types, are storage locations for a data value.
Used With
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation
Server, Server Script, Web Client Automation Server
Related Topics
GetValue Method on page 307
SetProperty Method on page 312
SetValue Method
ToString Method
This method converts the value of a property set to a string.
Syntax
oPropSet.toString();
Argument Description
Not applicable
Returns
The value of a property set as a string
Usage
This method is used in business service server scripts when it is necessary to convert property set
values to strings.
Used With
Server Script
Miscellaneous Methods
The following methods do not belong to any other category:
GetErrorCode Method
This method is used with the Java Data Bean to display numeric error codes.
Syntax
public int getErrorCode()
Argument Description
Not applicable
Returns
A numeric error code
Used With
Java Data Bean
Example
This example for the Siebel Java Data Bean retrieves the first record in the Account business
component. If an error occurs during execution, the script displays the error code and error message.
try
{
//Instantiate the Siebel Data Bean
Sieb_dataBean = new SiebelDataBean();
String Cstr = "GatewayServer, EntServer, FINSObjMgr";
Sieb_dataBean.login(Cstr, "SADMIN", "SADMIN");
SiebelBusObject m_busObject = Sieb_dataBean.getBusObject("Account");
SiebelBusComp m_busComp = m_busObject.getBusComp("Account");
m_busComp.activateField("Name");
m_busComp.executeQuery(true);
m_busComp.firstRecord();
Name = m_busComp.getFieldValue("Name");
System.out.println("Account Name : " + Name);
m_busComp.release();
m_busComp = null;
m_busObject.release();
m_busObject = null;
Sieb_dataBean.logoff();
Sieb_dataBean = null;
}
catch (SiebelException e)
{
ErrorText = "Code: " + e.getErrorCode() + "\n" + "Description: " +
e.getErrorMessage();
System.out.println("Error Occurred\n " + ErrorText);
}
...
Related Topic
GetErrorMessage Method
GetErrorMessage Method
This method is used with the Java Data Bean to display error messages.
Syntax
public string getErrorMessage()
Argument Description
Not applicable
Returns
A string containing an error message
Used With
Java Data Bean
Related Topic
GetErrorCode Method
TheApplication Method
TheApplication is a global method that returns the unique object of type Application. This is the root
of objects within the Siebel Applications object hierarchy. Use this method to determine the object
reference of the application, which is later used to find other objects or to invoke methods on the
application object.
VB Syntax
TheApplication
eScript Syntax
TheApplication()
Argument Description
Not applicable
Returns
Application, an object for use in finding other objects or invoking methods
Usage
For example, when using Siebel eScript to determine whether you are logged in to a server database
or local database, use TheApplication().InvokeMethod("GetDataSource").
Used With
Browser Script, Server Script
Example
The following example is in Siebel VB. It retrieves the login name from the application object and
creates the Employee business object.
sLoginName = TheApplication.LoginName
Set oEmpBusObj = TheApplication.GetBusObject("Employee")
This chapter presents a series of steps to build a simple COM client in Visual C++ and the Microsoft
Foundation Class (MFC) library, which accesses the Siebel Data Server. Use this to build real-time
interfaces to Siebel using C++ for integration purposes:
3 In the Project name field, enter SiebelCOM, and then click OK.
5 In the What other support would you like to include? frame, check Automation and clear
ActiveX Controls, and then click Next. Click Next again.
6 Click Finish.
7 Click OK.
The Application Wizard generates the standard MFC code that serves as the skeleton for this
project. Headers and libraries necessary to support COM automation are included. Refer to the
Microsoft Visual Studio [MSDN] documentation for a detailed description of the MFC libraries.
8 The newly created dialog box appears in the workspace. You can resize the box and change the
text in the label by editing its properties. Right-click the label in the dialog box to edit its
properties. Modify the dialog box so that it looks something like the following illustration.
d Enter the code that is highlighted in boldface in Figure 9 into the SiebelCOMDlg.h file.
class CSiebelCOMDlgAutoProxy;
//////////////////////////////////////////////////////////////
// CSiebelCOMDlg dialog
// Construction
public:
CSiebelCOMDlg(CWnd* pParent = NULL);// standard constructor
virtual ~CSiebelCOMDlg();
Figure 9. Code for SiebelCOMDlg.h
e Choose File > Open and select the SiebelCOMDlg.cpp file. Add the code that is highlighted in
boldface in Figure 10 to the OnInitDialog procedure.
BOOL CSiebelCOMDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this
// automatically when the applications main window
// is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
return TRUE; // return TRUE unless you set the focus to a control
}
f In the same file, add the code that is highlighted in boldface in Figure 11 and Figure 12 to the
OnOKDialog procedure. Make sure that the line beginning with sApp.LoadObjects points to the
location of the CFG file you intend to use. In the line beginning with sApp.Login, make sure that
you have entered a valid logon name and password.
void CSiebelCOMDlg::OnOK()
{
short sErr;
//Login as Sadmin
sApp.Login("SADMIN", "SADMIN", &sErr);
if (sErr)
{
AfxMessageBox("Login failed.");
return;
} else
{
AfxMessageBox("Logged into Siebel database.");
}
return;
if (CanExit())
CDialog::OnOK();
}
When you have finished creating your program, test it to make sure it works properly.
2 Choose Screens > Accounts > All Accounts. Verify that there is at least one account visible in the
Account list applet. If there is not, create one. Exit the Siebel client.
3 Open the CFG file you specified in the code and make sure that the DataSource key indicates the
database source you specified at logon in Step 2.
4 In Microsoft Visual C++, choose Build > Build SiebelCOM.exe, or press F7. If there are any errors
or warnings reported in the output window, correct the errors and repeat this step.
6 Click OK.
7 The application displays a series of message boxes, with the following messages:
The application displays the name of the first account in the All Accounts view.
This chapter provides a quick reference for Siebel COM Data Control methods. It has the following
topics:
Table 34 does not include methods that are not invoked directly from an Application object instance.
For information on methods that are called with InvokeMethod on the Application object, see
InvokeMethod Methods for the Application Object on page 139.
Table 35 does not include methods that are not invoked directly from a Business Component object
instance. For information on methods that are called with InvokeMethod on the Business Component
object, see InvokeMethod Methods for the Business Component Object on page 213.
ClearToQuery Method Clears the current query and Dim busComp as SiebelBusComp
sort specifications on the busComp.ClearToQuery
business component.
GetFieldValue Method Returns a value for the field Dim busComp as SiebelBusComp
specified in the argument. Dim sValue as String
sValue =
busComp.GetFieldValue(FieldName
as String)
GetFormattedFieldValue Returns a formatted value for Dim busComp as SiebelBusComp
Method the field specified in the Dim sValue as String
argument. sValue =
busComp.GetFormattedFieldValue(Fi
eldName as String)
GetLastErrCode Method Returns the most recent error Dim errCode As Integer
code. Dim SiebApp as SiebelDataControl
errCode=siebApp.GetLastErrCode
GetLastErrText Method Returns the most recent error Dim busComp as SiebelBusComp
text message. Dim sErr as String
busComp.GetLastErrText
SetViewMode Method Sets the visibility type for the Dim buscomp as SiebelBusComp
business component. Dim boolVal as Boolean
boolVal=buscomp.SetViewMode(mode
As Integer) As Boolean
UndoRecord Method Reverses any uncommitted Dim busComp as SiebelBusComp
changes made to the record. busComp.UndoRecord
Name Method Returns the name of the control. Dim busObject as SiebelBusObject
Dim sName as String
sName = busObject.Name
This chapter provides a quick reference for Siebel COM Data Server methods. It has the following
topics:
Table 39 does not include methods that are not invoked directly from an Application object instance.
For information on methods that are called with InvokeMethod on the Application object, see
InvokeMethod Methods for the Application Object on page 139.
TraceOff Method Turns off the tracing started Dim application as SiebelApplication
by TraceOn. application.TraceOff(ErrCode as Integer)
Table 40 does not include methods that are not invoked directly from a Business Component object
instance. For information on methods that are called with InvokeMethod on the Business Component
object, see InvokeMethod Methods for the Business Component Object on page 213.
GetUserProperty Method Returns the value for the Dim busComp as SiebelBusComp
property name whose name Dim sValue as String
is specified in the argument. sValue =
busComp.GetUserProperty(propertyNa
me as String, ErrCode as Integer)
GetViewMode Method Returns the visibility mode Dim busComp as SiebelBusComp
for the business component. Dim iMode as Integer
iMode =
busComp.GetViewMode(ErrCode as
Integer)
LastRecord Method Moves to the last record in Dim busComp as SiebelBusComp
the business component. Dim bReturn as Boolean
bReturn =
busComp.LastRecord(ErrCode as
Integer)
Name Method Returns the name of the Dim busComp as SiebelBusComp
business component. Dim sName as String
sName = busComp.Name(ErrCode as
Integer)
NewRecord Method Adds a new record to the Dim busComp as SiebelBusComp
business component. busComp.NewRecord(whereIndicator
as Integer, ErrCode as Integer)
NextRecord Method Moves to the next record in Dim busComp as SiebelBusComp
the business component. Dim bReturn as Boolean
bReturn =
busComp.NextRecord(ErrCode as
Integer)
ParentBusComp Method Returns the parent business Dim busComp as SiebelBusComp
component. Dim parentBusComp as SiebelBusComp
Set parentBusComp =
busComp.ParentBusComp(ErrCode as
Integer)
SetViewMode Method Sets the visibility type for Dim buscomp as SiebelBusComp
the business component. buscomp.SetViewMode(mode As
Integer, errCode As Integer)
UndoRecord Method Reverses any uncommitted Dim busComp as SiebelBusComp
changes made to the record. busComp.UndoRecord(ErrCode as
Integer)
WriteRecord Method Commits to the database any Dim busComp as SiebelBusComp
changes made to the current busComp.WriteRecord(ErrCode as
record Integer)
This chapter provides a quick reference for Siebel Mobile Web Client Automation Server methods. It
has the following topics:
Business Component Methods for Mobile Web Client Automation Server on page 354
Business Object Methods for Mobile Web Client Automation Server on page 358
Business Service Methods for Mobile Web Client Automation Server on page 359
Property Set Methods for Mobile Web Client Automation Server on page 360
Table 44 does not include methods that are not invoked directly from an Application object instance.
For information on methods that are called with InvokeMethod on the Application object, see
InvokeMethod Methods for the Application Object on page 139.
Table 45 does not include methods that are not invoked directly from a Business Component object
instance. For information on methods that are called with InvokeMethod on the Business Component
object, see InvokeMethod Methods for the Business Component Object on page 213.
ClearToQuery Method Clears the current query and Dim busComp as SiebelBusComp
sort specifications on the Dim bool as Boolean
business component. bool = busComp.ClearToQuery
SetViewMode Method Sets the visibility type for the Dim buscomp as SiebelBusComp
business component. buscomp.SetViewMode(mode As
Integer)
UndoRecord Method Reverses any uncommitted Dim busComp as SiebelBusComp
changes made to the record. busComp.UndoRecord
This chapter provides a quick reference for Siebel Java Data Bean methods. It has the following
topics:
Detach Method Returns a string containing the String detach() throws SiebelException
Siebel session ID.
Logoff Method Disconnects the client from boolean logoff() throws SiebelException
the server.
Trace Method The Trace method appends a boolean trace(String message) throws
message to the trace file. SiebelException
Trace is useful for debugging
SQL query execution. This
method does not trace Java
standard output.
TraceOff Method TraceOff turns off the tracing boolean traceOff() throws
started by the TraceOn SiebelException
method. This method does not
trace Java standard output.
TraceOn Method TraceOn turns on the tracking boolean traceOn(String filename, String
of allocations and Category, String selection)throws
deallocations of Siebel objects, SiebelException
and SQL statements generated
by the Siebel application. This
method does not trace Java
standard output.
Table 50 does not include methods that are not invoked directly from a Business Component object
instance. For information on methods that are called with InvokeMethod on the Business Component
object, see InvokeMethod Methods for the Business Component Object on page 213.
ClearToQuery Method Clears the current query and boolean clearToQuery() throws
sort specifications on the SiebelException
business component.
LastRecord Method Moves to the last record in the boolean lastRecord() throws
business component. SiebelException
SetViewMode Method Sets the visibility type for the boolean setViewMode(int mode)
business component. throws SiebelException
For more information on the Java Data Bean Interface, read the Javadoc files, which are contained
in a file named Siebel_JavaDoc.jar. This file is normally located in: \siebsrvr\CLASSES.
This chapter provides a quick reference for Siebel Web Client Automation Server methods. It has the
following topics:
SiebelService Methods for Siebel Web Client Automation Server on page 374
Property Set Methods for Siebel Web Client Automation Server on page 375
Table 55 does not include methods that are not invoked directly from an Application object instance.
For information on methods that are called with InvokeMethod on the Application object, see
InvokeMethod Methods for the Application Object on page 139.
GetType Method Returns the value stored in a type Dim oPropSet as SiebelPropertySet
in a property set. Dim type as String
type = oPropSet.GetType
GetValue Method Returns a value stored as part of Dim oPropSet as SiebelProperty
a property set. SetDim sValue as String
sValue = oPropSet.GetValue
InsertChildAt Inserts a child property set into a Dim oPropSet as SiebelPropertySet
Method parent property set at a specific oPropSet.InsertChildAt(childObject
location. as SiebelPropertySet, index as Long)
BusComp Method Function that returns the business Dim oApplet as Applet
component that is associated with Dim oBusComp as BusComp
the applet. Set oBusComp = oApplet.BusComp
BusObject Method Function that returns the business Dim oApplet as Applet
object for the business component Dim oBusObject as BusObject
of the applet. Set oBusObject = oApplet.BusObject
Table 60 does not include methods that are not invoked directly from an Application object instance.
For information on methods that are called with InvokeMethod on the Application object, see
InvokeMethod Methods for the Application Object on page 139.
GotoView Method Activates the named view and Dim oApplication as Application
its business object. oApplication.GotoView viewName as
String, [BusinessObjectName as
BusObject]
TraceOff Method Turns off the tracing started Dim oApplication as Application
by TraceOn. oApplication.TraceOff
Table 62 does not include methods that are not invoked directly from a Business Component object
instance. For information on methods that are called with InvokeMethod on the Business Component
object, see InvokeMethod Methods for the Business Component Object on page 213.
LastRecord Method Moves to the last record in the Dim oBusComp as BusComp
business component. Dim iReturn as Integer
iReturn = oBusComp.LastRecord
Name Method Function that returns the Dim oBusComp as BusComp
name of the business Dim sName as String
component. sName = oBusComp.Name
12 Browser Scripting
This chapter provides information about Browser Scripting and its available events and methods:
NOTE: Browser Script may only be used with applications which run in high interactivity mode,
except when scripting Control events supported by the Browser Document Object Model. Refer to
Table 80 and Table 81 for a list of supported DOM events.
Do not use browser scripts to manipulate the location of a frame or form in the Siebel application
because this causes a new page to be loaded. The result is a permission denied error, as it is a
violation of good security practices.
A high interactivity application can contain standard interactivity views (Home Page view and
Dashboard view for example). Applet-level browser scripts cannot be used on applets in those views
(the same as in standard interactivity applications). Instead the server script
WebApplet_ShowControl that is not supported in high interactivity is triggered on the applets for
those standard interactivity views.
For information on generating browser scripts, see Configuring Siebel Business Applications.
Table 71 does not include methods that are not invoked directly from an Application object instance.
For information on methods that are called with InvokeMethod on the Application object, see
InvokeMethod Methods for the Application Object on page 139.
Table 73 does not include methods that are not invoked directly from a Business Component object
instance. For information on methods that are called with InvokeMethod on the Business Component
object, see InvokeMethod Methods for the Business Component Object on page 213.
Applet Method Returns the parent applet for the var oControl;
control. var oApplet;
oApplet = oControl.Applet();
BusComp Method Returns the corresponding var oControl;
business component for the var busComp;
control. busComp = oControl.Buscomp();
Siebel Control
Control Type Supported Events Comments
Button Native OnFocus None
OnBlur
Siebel Control
Control Type Supported Events Comments
NOTE: Siebel objects (business components, applets, and so on) cannot be accessed from DOM
events.
Usually in scripting you can call routines in the General section from anywhere in the object. However
you cannot call routines written in the General section from the DOM events.
To associate a script with the control_OnClick event (high interactivity mode only), use the
Applet_PreInvokeMethod event associated with the applet. For additional information and example,
read Chapter 14, Invoking Custom Methods with MiniButton Controls.
Table 81. Supported DOM Events and Template Modes for Standard Interactivity Mode
Siebel Control
Control Type Supported Events Comments
Table 81. Supported DOM Events and Template Modes for Standard Interactivity Mode
Siebel Control
Control Type Supported Events Comments
NOTE: The ST eScript engine is the default eScript scripting engine in version 8.0. For information
on syntax differences between it and the T engine, see Siebel eScript Language Reference.
Table 84 does not include methods that are not invoked directly from an Application object instance.
For information on methods that are called with InvokeMethod on the Application object, see
InvokeMethod Methods for the Application Object on page 139.
Table 86 does not include methods that are not invoked directly from a Business Component object
instance. For information on methods that are called with InvokeMethod on the Business Component
object, see InvokeMethod Methods for the Business Component Object on page 213.
This chapter provides a procedure to invoke a custom method with a MiniButton control.
Name = ButtonTest
Caption = Test
HTML Type = MiniButton
Method Invoked = MyTest
The Web Layout Editor appears. The Controls/Columns window opens with the available controls,
including the one you just created.
4 Drag and drop the ButtonTest control onto an available location. When you release the mouse
button, the button appears.
To add a server script to the applet, right-click the applet and choose Edit Server Scripts. Add
the following script to the WebApplet_PreCanInvokeMethod() function.
if (MethodName == "MyTest")
CanInvoke = "TRUE";
return(CancelOperation);
return(ContinueOperation);
To enable the button declaratively, select the applet in the Object List Editor, expand the
Applet object in the Object Explorer, select the Applet User Prop object, and then create a
new user property for the applet in the Object List Editor:
Name Value
For more information on the CanInvokeMethod user property, see Siebel Developers
Reference.
7 Add the following browser script to the applet you are using (for example, the Account List
Applet):
switch (name) {
case "MyTest":
alert("Browser script!");
return("CancelOperation");
break;
return("ContinueOperation");
8 Compile the applet object by right-clicking on it and then choosing Compile Selected Objects.
9 Run any application that has access to accounts, and navigate to My Accounts.
10 Click Test.
The Browser Script displays an alert box indicating Browser Script!
Index
business service events syntax summary business service methods syntax summary
(eScript), table of 421 (table) 334, 335
business service events syntax summary installation, about 33
(Siebel VB), table of 390 load balancing with 73
business service methods syntax summary property set methods syntax summary
(COM data control), table 334, 335 (table) 335
business service methods syntax summary COM data server
(COM data server), table 347 application methods syntax summary
business service methods syntax summary (table) 339
(eScript), table of 420 business component methods syntax
business service methods syntax summary summary (table) 342
(Siebel VB), table of 389 business object methods syntax summary
events syntax summary (Browser Script), (table) 346
table of 402 business service methods syntax summary
methods syntax summary (Browser Script), (table) 347
table of 401 installation, about 33
methods syntax summary (mobile Web interface method, about COM error
client), table 359 handling 74
object interface events, table of 91 LoadObjects method, about using to start
object interface methods, table of 85 object and return reference 143
registering in Siebel Tools 132 property set methods syntax summary
retrieving property names 273 (table) 348
SetProperty, about assigning values to COM error handling, about and methods 74
members of 280 COM interfaces
SiebelService methods syntax summary Siebel COM client in C++, building 319
(Java), table of 369 Siebel COM client in C++, testing
BusObject program 325
applet method, about 93 comparison operators, using in search
business component method, about 184 expressions 240
connect string
C about, syntax, and example 71
C++ leveraging load balancing with 73
Siebel COM Server, building in 319 Siebel Server, substitutions when logging into
Siebel COM Server, testing program 325 (table) 72
CanInvokeMethod applet user property, constants, table of 91
using instead of control methods
PreCanInvokeMethod applet Applet method, about returning parent applet
event 108, 426 object 288
ChangeFieldValue, about 99 BusComp, about 289
ChangeRecord event, about 101 GetProperty, about 289
ClearLOVCache business component GetValue, about returning control value 290
method, about 214 Name, about returning object name 291
ClearToQuery business component method, SetProperty, about 291, 293
about 185 SetValue, about using to set contents of the
coding, caution, about and using Siebel control 294
Tools 15 syntax summary, table of (Browser Script),
COM data control table of 404
application methods syntax summary controls
(table) 327 FindControl, about argument specified in 95
business component methods syntax GetProperty, returning values of control
summary (table) 330 properties 289
business object methods syntax summary GetValue, returning value of control 290
(table) 334 object interface methods, table of 86
SetLabelProperty, assigning values to control