Share

Siebel Browser Scripting – An Overview

Post by Rachna Agarwal

Browser Script 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. The DOM for Internet Explorer and Netscape Navigator are different. Using Siebel Tools you can write scripts for the appropriate browser type by selecting the appropriate User Agent.

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.

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 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.

Applet Methods for Browser Script

• ActiveMode Method

It returns a string containing the name of the current Web Template mode.
var oApplet;
var mode = oApplet.ActiveMode();

• BusComp Method

It returns the business component that is associated with the applet.
var oApplet;
var busComp = oApplet.BusComp();

• BusObject Method

It returns the business object for the business component for the applet.
var oApplet;
var oBusObject = oApplet.BusObject();

• FindActiveXControl Method

Returns the ActiveX control whose name is specified in the argument.
var oApplet;
var oControl;
oControl =
oApplet.FindActiveXControl(controlName);

• FindControl Method

It returns the control whose name is specified in the argument.
var oApplet;
var oControl;
oControl = oApplet.FindControl(controlName);

• InvokeMethod Method

It calls an argument-specified specialized method.
var oApplet;
var outPs =
theApplication().NewPropertySet();
outPs = oApplet.InvokeMethod(MethodName, inputPropSet);

• Name Method

It returns the name of the applet.
var oApplet;
var name = oApplet.Name();

Applet Events for Browser Script

• Applet_ChangeFieldValue Event

Called when the user updates a field value in the browser.
Applet_ChangeFieldValue (field, value)

• Applet_ChangeRecord Event

Called when the user moves to a different row or view.
Applet_ChangeRecord()

• Applet_InvokeMethod Event

Called after a specialized method or a user-defined method is invoked.
Applet_InvokeMethod (name, inputPropSet)

• Applet_Load Event

Triggered after an applet has loaded and after data is displayed.
Applet_Load()

Applet_PreInvokeMethod Event

Called before a specialized method for the Web applet is invoked or a user-defined method
is invoked through oWebApplet.InvokeMethod.
Applet_PreInvokeMethod (name, inputPropSet)

Business Component Methods for Browser Script

• BusObject Method

Returns the business object that contains the business component.
var busComp;
var busObject;
busObject = busComp.BusObject();

• GetFieldValue Method

Returns a value for the field specified in the argument.
var busComp;
var value;
value = busComp.GetFieldValue(fieldName);

• GetFormattedFieldValue Method

Returns a formatted value for the field specified in the argument.
var busComp;
var sValue;
sValue = busComp.GetFormattedFieldValue(fieldName);

• GetSearchExpr Method

Returns the current search expression.
var busComp;
var sExpr;
sExpr = busComp.GetSearchExpr();

• GetSearchSpec Method

Returns the current search specification for the field specified in the argument.
var busComp;
var sSpec;
sSpec = busComp.GetSearchSpec(fieldName);

• Name Method

Returns the name of the business component.
var busComp;
var sName;
sName = busComp.Name();

• SetFieldValue Method

Assigns a new value to the named field for the current row of the business component.
var busComp;
busComp.SetFieldValue(fieldName,fieldValue);

• SetFormattedFieldValue Method

Accepts the field value in the current local format and assigns the new value to the named field for the current row of the business component.
var busComp;
busComp.SetFormattedFieldValue(fieldName, fieldValue);
WriteRecord Method Commits to the database any changes made to the current record.
var busComp;
busComp.WriteRecord();

• BusComp_PreSetFieldValue Event

Called when a value is pushed down into the business component from the user interface. This Browser Script event is not invoked if the ‘Immediate Post Changes’ property of the Business
Component field is set to TRUE.
BusComp_PreSetFieldValue(fieldName, value);

Business Object Methods for Browser Script

• GetBusComp Method

Returns the specified business component.
var busObject;
var Comp;
busComp = busObject.GetBusComp(busCompName);

• Name Method

Returns the name of the business object.
Var sName;
var busObject;
sName = budObject.Name();

Business Service Methods for Browser Script

• GetFirstProperty Method

Retrieves the name of the first property of a business service.
var svc;
var sName = svc.GetFirstProperty();

• GetNextProperty Method

Once the name of the first property has been retrieved, retrieves the name of the next property of a business service.
var svc;
var sName = svc.GetNextProperty();

• GetProperty Method
Retrieves the value stored in the specified property.
var svc;
var value;
value = svc.GetProperty(name);

• InvokeMethod Method

Calls a specialized method or a user-created method on the business service.
var svc;
var oPropSet=theApplication().NewPropertySet();
oPropSet = svc.InvokeMethod(methodName,inputPropSet);

• Name Method

It returns the name of the business service.
var svc;
var name;
name = svc.Name();

• PropertyExists Method

Returns a Boolean value indicating whether the property specified in the argument exists.
var svc;
var bool;
bool = svc.PropertyExists(name);

• RemoveProperty Method

Removes a property from a business service.
var svc;
svc.RemoveProperty(name);

• SetProperty Method

Assigns a value to a property of a business service.
var svc;
svc.SetProperty(name, value);

3 comments on “Siebel Browser Scripting – An Overview”

  1. tagabukidph Reply

    if i have both browser script AND server script in a BusComp’s PreSetFieldValue method, which will be executed first?

    if the browser script encounters the “ContinueOperation”, will it proceed with the SetFieldValue method thus skipping the server script’s PreSetFieldValue codes?

    thanks in advance.

  2. Neelima Reply

    Response :

    If there is browser and server script both in a BusComp’s PreSetField Value method, Browser script gets fired first. 
    Secondly if the browser script encounters the “ContinueOperation” , it will go to the PresetFiled Value event on the server side and once that is completed then it will proceed with the SetFieldValue event Browser script.

Leave A Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!