6Browser Script Quick Reference

Applet Methods for Browser Script

The following table describes a summary of the applet methods you can use in Browser Script.

Table Summary of Applet Methods for Browser Script

Method Description Format

ActiveMode Method for an Applet

Returns a string that contains the name of the current Web template mode.

var oApplet;

var mode = oApplet.ActiveMode();

BusComp Method for an Applet

Returns the name of the business component that an applet references.

var oApplet;

var busComp = oApplet.BusComp();

BusObject Method for an Applet

Returns the name of the business object for the business component that an applet references.

var oApplet;

var oBusObject = oApplet.BusObject();

FindActiveXControl Method for an Applet

Returns the name of a control that is a Document Object Model element.

var oApplet;

var oControl;

oControl = oApplet.FindActiveXControl (controlName as String);

FindControl Method for an Applet

Returns the name of a control.

var oApplet;

var oControl;

oControl = oApplet.FindControl(controlName as String);

InvokeMethod Method for an Applet

Calls a method.

var oApplet;

var outPs;

outPs = oApplet.InvokeMethod(MethodName as String, inputPropSet as PropertySet);

Name Method for an Applet

Returns the name of an applet.

var oApplet;

var name = oApplet.Name();

Applet Events For Browser Script

The following table describes a summary of the applet events you can use in Browser Script.

Table Summary of Applet Events for Browser Script

Event Description Format

Applet_ChangeFieldValue Event

Starts if the user uses an applet to modify data in a field.

Applet_ChangeFieldValue (field, value)

Applet_ChangeRecord Event

Starts if the user moves to a different record or view.

Applet_ChangeRecord()

Applet_InvokeMethod Event

Starts after a specialized method or after a custom method is called.

Applet_InvokeMethod (name, inputPropSet)

Applet_Load Event

Starts after Siebel CRM loads an applet and after it displays data.

Applet_Load()

Applet_PreInvokeMethod Event

Siebel CRM calls this event immediately before it calls a specialized method on an applet.

Applet_PreInvokeMethod (name, inputPropSet)

Application Methods for Browser Script

The following table describes a summary of the application methods you can use in Browser Script. It does not include object interface methods that Siebel CRM does not call directly from an application object instance. For information about methods it calls with the InvokeMethod method on the application object, see LoadObjects Method for an Application.

Table Summary of Application Methods for Browser Script

Method Description Format

ActiveApplet Method for an Application

Returns the name of the active applet.

var applet;

applet = theApplication().ActiveApplet();

ActiveBusComp Method for an Application

Returns the name of the business component that the active applet references.

var busComp;

busComp = theApplication().ActiveBusComp();

ActiveBusObject Method for an Application

Returns the name of the business object for the business component that the active applet references.

var busObject;

busObject = theApplication().ActiveBusObject();

ActiveViewName Method for an Application

Returns the name of the active view.

var viewName;

viewName = theApplication().ActiveViewName();

FindApplet Method for an Application

Returns the name of an applet.

var applet;

applet = theApplication().FindApplet (appletName);

GetProfileAttr Method for an Application

Returns the name of an attribute in a user profile.

var sAttr;

sAttr = theApplication().GetProfileAttr(name);

GetService Method for an Application

Locates a business service. If this business service is not already running, then Siebel CRM starts it.

var svc;;

svc = theApplication().GetService (serviceName)

InvokeMethod Method for an Application

Calls a method.

var outPs;

outPs = theApplication().InvokeMethod (methodName, methArg1, methArg2, methArgN);

Name Method for an Application

Returns the name of the Siebel application.

var appName;

appName = theApplication().Name();

NewPropertySet Method for an Application

Creates a new property set.

var PropSet;

PropSet = theApplication().NewPropertySet();

SetProfileAttr Method for an Application

Personalization uses this method to set a value for an attribute in a user profile.

theApplication().SetProfileAttr(name, value);

ShowModalDialog Method for an Application

Allows you to display a dialog box with the cursor in the default state.

theApplication().ShowModalDialog (url[, argin][, options])

SWEAlert Method for an Application

Displays a modal dialog box that includes a message.

theApplication().SWEAlert(message);

Application Events for Browser Script

The following table describes a summary of the application events you can use in Browser Script.

Table Summary of Application Events for Browser Script

Event Description Format

Application_InvokeMethod Event

Called after Siebel CRM calls a specialized method.

Application_InvokeMethod (name, inputPropSet)

Application_PreInvokeMethod Event

Called after Siebel CRM calls a specialized method.

Application_PreInvokeMethod (name, inputPropSet)

Business Component Methods for Browser Script

The following table describes a summary of the business component methods you can use in Browser Script. It does not include object interface methods that Siebel CRM does not call directly from a Business Component object instance. For information about methods that it calls with InvokeMethod method on the Business Component object, see Business Component Invoke Methods.

Table Summary of Business Component Methods for Browser Script

Method Description Format

BusObject Method for a Business Component

Returns the name of the business object that the business component references.

var busComp;

var busObject;

busObject = busComp.BusObject();

GetFieldValue Method for a Business Component

Returns the value of a field from the current record of a business component.

var busComp;

var value;

value = busComp.GetFieldValue(fieldName);

GetFormattedFieldValue Method for a Business Component

Returns a field value that is in the same format that the Siebel client uses.

var busComp;

var sValue;

sValue = busComp.GetFormattedFieldValue (fieldName);

GetSearchExpr Method for a Business Component

Returns the current search expression that is defined for the business component.

var busComp;

var sExpr;

sExpr = busComp.GetSearchExpr();

GetSearchSpec Method for a Business Component

Returns the search specification for a field.

var busComp;

var sSpec;

sSpec = busComp.GetSearchSpec(fieldName);

InvokeMethod Method for a Business Component

Calls a method.

var busComp;

var sReturn;

sReturn = busComp.InvokeMethod(methodName, methodArg1, methodArg2,..., methodArgn);

Name Method for a Business Component

Returns the name of a business component.

var busComp;

var sName;

sName = busComp.Name();

SetFieldValue Method for a Business Component

Sets a new value for a field in the current record of a business component.

var busComp;

busComp.SetFieldValue(fieldName, fieldValue);

SetFormattedFieldValue Method for a Business Component

Sets the new value to a field for the current record of a business component.

var busComp;

busComp.SetFormattedFieldValue (fieldName, fieldValue);

UndoRecord Method for a Business Component

Reverses any unsaved modifications that Siebel CRM has made on a record.

var busComp;

busComp.UndoRecord();

WriteRecord Method for a Business Component

Saves to the Siebel database any modifications made to the current record.

var busComp;

busComp.WriteRecord();

Business Component Events for Browser Script

The following table describes a summary of the business component events you can use in Browser Script.

Table Summary of Business Component Events for Browser Script

Event Description Format

BusComp_PreSetFieldValue Event

Called if the user modifies a value in the Siebel client.

BusComp_PreSetFieldValue (fieldName, value)

Business Object Methods for Browser Script

The following table describes a summary of the business object methods you can use in Browser Script.

Table Summary of Business Object Methods for Browser Script

Method Description Format

GetBusComp Method for a Business Object

Returns the name of a business component.

var busObject;

var busComp;

busComp = busObject.GetBusComp(busCompName);

Name Method for a Business Object

Returns the name of a business object.

Var sName;

var busObject;

sName = busObject.Name();

Business Service Methods for Browser Script

The following table describes a summary of the business service methods you can use in Browser Script.

Table Summary of Business Service Methods for Browser Script

Method Description Format

GetNextProperty Method for a Business Service

Returns the name of the next property of a business service.

var svc;

var sName = svc.GetNextProperty();

GetProperty Method for a Business Service

Returns the value of a property.

var svc;

var value;

value = svc.GetProperty(name);

InvokeMethod Method for a Business Service

Calls a method on a business service.

var svc = TheApplication().GetService("Business Service");

var inputPropSet = TheApplication().NewPropertySet();

svc.InvokeMethod(methodName, inputPropSet);

Name Method for a Business Service

Returns the name of a business service.

var svc;

var name;

name = svc.Name();

PropertyExists Method for a Business Service

Returns a Boolean value that indicates if the property that the argument identifies exists.

var svc;

var bool;

bool = svc.PropertyExists(name);

RemoveProperty Method for a Business Service

Removes a property from a business service.

var svc;

svc.RemoveProperty(name);

SetProperty Method for a Business Service

Sets a value for a property of a business service.

var svc;

svc.SetProperty(name, value);

Business Service Events for Browser Script

The following table describes a summary of the business service events you can use in Browser Script.

Table Summary Business Service Events for Browser Script

Method Description Format

Service_InvokeMethod Event

Called after Siebel CRM calls the InvokeMethod method on a business service.

Service_InvokeMethod (methodName,input)

Service_PreCanInvokeMethod Event

Called before Siebel CRM calls the PreInvokeMethod event. It allows you to determine if the user possesses the authority to call the business service method.

Service_PreCanInvokeMethod (methodName)

Service_PreInvokeMethod Event

Called before Siebel CRM calls a method on a business service.

Service_PreInvokeMethod (methodName, inputPropSet)

Property Set Methods for Browser Script

The following table describes a summary of the property set methods you can use in Browser Script.

Table Summary of Property Set Methods for Browser Script

Method Description Format

AddChild Method for a Property Set

Adds a child property set to a property set.

var oPropSet;

var iIndex;

iIndex = oPropSet.AddChild(childObject);

Copy Method for a Property Set

Returns a copy of a property set.

var oPropSet1;

var oPropSet2;

oPropSet2 = oPropSet1.Copy();

GetChild Method for a Property Set

Returns the index number of a child property set.

var oPropSet;

var oChildPropSet;

oChildPropSet = oPropSet.GetChild(index);

GetChildCount Method for a Property Set

Returns the number of child property sets that exist for a parent property set

var oPropSet;

var iCount;

iCount = oPropSet.GetChildCount();

GetFirstProperty Method for a Property Set

Returns the name of the first property in a property set.

var oPropSet;

var sPropName;

sPropName = oPropSet.GetFirstProperty();

GetNextProperty Method for a Property Set

Returns the name of the next property in a property set.

var oPropSet;

var sPropName;

sPropName = oPropSet.GetNextProperty();

GetProperty Method for a Property Set

Returns the value of a property.

var oPropSet;

var sValue;

sValue = oPropSet.GetProperty(propName);

GetPropertyCount Method for a Property Set

Returns the number of properties that exist in the current level in the hierarchy.

var oPropSet;

var iCount;

iCount = oPropSet.GetPropertyCount();

GetType Method for a Property Set

Returns the value of the type attribute of a property set.

var oPropSet;

var type;

type = oPropSet.GetType();

GetValue Method for a Property Set

Returns the value of the value attribute of a property set.

var oPropSet;

var sValue;

sValue = oPropSet.GetValue();

InsertChildAt Method for a Property Set

Inserts a child property set in a parent property set at a specific location.

var oPropSet;oPropSet.InsertChildAt(childObject, index);

PropertyExists Method for a Property Set

Returns a Boolean value that indicates if the property that the argument identifies exists.

var oPropSet;

var bool;

bool = oPropSet.PropertyExists(propName);

RemoveChild Method for a Property Set

Removes a child property set from a parent property set.

var oPropSet;

oPropSet.RemoveChild(index);

RemoveProperty Method for a Property Set

Removes a property from a property set.

var oPropSet;

oPropSet.RemoveProperty(propName);

Reset Method for a Property Set

Removes every property and child property set from a property set.

var oPropSet;

oPropSet.Reset();

SetProperty Method for a Property Set

Sets a value in the property of a property set.

var oPropSet;

oPropSet.SetProperty(propName, propValue)

SetType Method for a Property Set

Sets the value for the type attribute of a property set.

var oPropSet;

oPropSet.SetType(value);

SetValue Method for a Property Set

Sets the value for the value attribute of a property set.

var oPropSet;

oPropSet.SetValue(value);

Control Methods for Browser Script

The following table describes a summary of the control methods you can use in Browser Script.

Table Summary of Control Methods for Browser Script

Method Description Format

Applet Method for a Control

Returns the name of the applet where a control resides.

var oControl;

var oApplet;

oApplet = oControl.Applet();

BusComp Method for a Control

Returns the name of the business component that an applet references. The control resides in this applet.

var oControl;

var busComp;

busComp = oControl.BusComp();

GetProperty Method for a Control

Returns the value of the property of a control.

var oControl;

var propVal;

propVal = oControl.GetProperty(propName);

GetValue Method for a Control

Returns the value of a control.

var oControl;

var sValue;

sValue = oControl.GetValue();

Name Method for a Control

Returns the name of a control.

var oControl;

var sName;

sName = oControl.Name();

SetProperty Method for a Control

Sets the visual properties of a control.

var oControl;

oControl.SetProperty(propName, propValue);

SetValue Method for a Control

Sets the contents of a control.

var oControl;

oControl.SetValue(value;

Document Object Model Events You Can Use

This topic describes Document Object Model events you can use.

    Document Object Model Events

    The following information lists the Document Object Model events. For each control, you can use the following events:

    • OnFocus

    • OnBlur

    Note that scriptable events are not available for List Column and Tree controls.

    Table Document Object Model Events

    Control Siebel Control Type Description

    Button

    Native

    None

    CheckBox

    Native

    Rendered as Input Type is CHECKBOX.

    Link

    Native

    Rendered through paired anchor tags or as INPUT TYPE is TEXT in edit mode.

    List Column

    Native

    None

    Mailto

    Native

    Rendered as anchor tags with HREF is mailto or as INPUT TYPE is TEXT in Edit mode.

    MiniButton

    Native

    None

    Password

    Native

    Rendered as Input Type is password.

    Text

    Native

    Rendered as INPUT TYPE is TEXT or as SELECT if attached to a picklist. If there is a pop-up window, then Siebel CRM renders it as an edit box plus a button.

    TextArea

    Native

    Rendered as TEXTAREA.

    Tree

    Native

    None

    URL

    Native

    Rendered through paired anchor tags with an HREF equal to the underlying field value or as INPUT TYPE is TEXT in edit mode.

    You cannot access a Siebel object from a Document Object Model event. Business components and applets are examples of Siebel objects.

    You can typically call code in the General section from anywhere in an object. However, you cannot call code written in the General section from a Document Object Model event.

    To associate a script with the control_OnClick event, use the Applet_PreInvokeMethod event that is associated with the applet. For more information, see Using a MiniButton Control to Call a Custom Method.