8Siebel eScript Quick Reference

Siebel eScript Quick Reference

This chapter describes summary information for Siebel eScript. It includes the following topics:

The ST eScript engine is the default Siebel eScript scripting engine in Siebel CRM version 8.0 and later. For information about format differences between it and the traditional (T) engine, see Siebel eScript Language Reference.

Applet Methods for Siebel eScript

The following table describes a summary of the applet methods you can use with Siebel eScript.

Table Summary of Applet Methods for Siebel eScript

Method Description Format

BusComp Method for an Applet

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

var applet;

var myBusComp;

myBusComp = applet.BusComp();

BusObject Method for an Applet

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

var applet;

var busObject;

busObject = applet.BusObject();

InvokeMethod Method for an Applet

Calls a specialized method.

var applet;

applet.InvokeMethod(methodName, methodArg1, methodArg2, …, methodArgn);

Name Method for an Applet

Returns the name of an applet.

var applet;

var sApplet;

sApplet = applet.Name();

Web Applet Events for Siebel eScript

The following table describes a summary of web applet events you can use with Siebel eScript.

Table Summary of Web Applet Events for Siebel eScript

Event Description Format

WebApplet_InvokeMethod Event

Siebel CRM calls this event after a specialized method on the Web applet runs.

WebApplet_InvokeMethod (MethodName)

WebApplet_Load Event

Siebel CRM calls this event immediately after it loads an applet.

WebApplet_Load

WebApplet_PreCanInvokeMethod Event

Called before Siebel CRM calls the PreInvokeMethod event, allowing you to determine if the user possesses the authority to call the applet method.

WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)

WebApplet_PreInvokeMethod Event

Siebel CRM calls this event before it calls a specialized method for the Web applet or a custom method that it calls through the oWebApplet object of the InvokeMethod method.

WebApplet_PreInvokeMethod (MethodName)

Application Methods for Siebel eScript

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

Table Summary of Application Methods for Siebel eScript

Method Description Format

ActiveBusObject Method for an Application

Returns the name of the business object that the active view references.

var busObject;

busObject = TheApplication().ActiveBusObject();

ActiveViewName Method for an Application

Returns the name of the active view.

var sView;

sView = TheApplication().ActiveViewName();

CurrencyCode Method for an Application

Returns the currency code that is associated with the division of the user position.

var sCur;

sCur = TheApplication().CurrencyCode();

GetBusObject Method for an Application

Creates a new instance of a business object.

var myBusObject;

myBusObject = TheApplication().GetBusObject (BusObjectName);

Name Method for an Application

Returns the name of the Siebel application.

var name;

name = TheApplication().Name();

GetService Method for an Application

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

var Service;

Service = TheApplication().GetService (serviceName);

GetSharedGlobal Method for an Application

Returns the shared global variables.

var sName;

sName = TheApplication().GetSharedGlobal (varName);

GotoView Method for an Application

Activates a view.

TheApplication().GotoView(viewName[, BusinessObject]);

InvokeMethod Method for an Application

Calls a method.

TheApplication().InvokeMethod (methodName, methodArg1, methodArg2,..., methodArgn);

LoginId Method for an Application

Returns the login ID of the user who started the Siebel application.

var sID;

sID = TheApplication().LoginId();

LoginName Method for an Application

Returns the login name of the user who started Oracle’s Siebel application.

var sUser;

sUser = TheApplication().LoginName();

NewPropertySet Method for an Application

Creates a new property set.

var oPropSet;

oPropSet = TheApplication().NewPropertySet();

PositionId Method for an Application

Returns the position ID of the user position.

var sRow; sRow = TheApplication().PositionId();

PositionName Method for an Application

Returns the name of the current user position.

var sPosition;

sPosition = TheApplication().PositionName();

RaiseError Method for an Application

Sends a scripting error message to the browser. To determine the error text, Siebel CRM uses a key to look up the current language.

var keyVal;

var arg1 ...;

TheApplication().RaiseError(keyVal, arg1, …);

RaiseErrorText Method for an Application

Sends a scripting error message to the browser.

var message;

TheApplication().RaiseErrorText (message);

SetPositionId Method for an Application

Sets the active position to a position ID.

var success;

success = TheApplication().SetPositionId (posId);

SetPositionName Method for an Application

Sets the active position to a position name.

var success;

success = TheApplication().SetPositionName (posName);

SetProfileAttr Method for an Application

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

TheApplication().SetProfileAttr (name, value);

SetSharedGlobal Method for an Application

Sets a shared global variable.

TheApplication().SetSharedGlobal (varName, value);

Trace Method for an Application

Appends a message to the trace file.

TheApplication().Trace(message);

TraceOff Method for an Application

Turns off tracing.

TheApplication().TraceOff();

TraceOn Method for an Application

Turns on tracing.

TheApplication().TraceOn(filename, type, selection);

Application Events for Siebel eScript

The following table describes a summary of application events you can use with Siebel eScript.

Table Summary of Application Events for Siebel eScript

Event Description Format

Application_Close Event

Called before the Siebel application exits.

Application_Close()

Application_InvokeMethod Event

Called after a specialized method is called.

Application_InvokeMethod(methodName)

Application_Navigate Event

Called after the user navigates to a view.

Application_Navigate()

Application_PreInvokeMethod Event

Called before Siebel CRM calls a specialized method.

Application_PreInvokeMethod(methodName)

Application_PreNavigate Event

Called before the Siebel application displays the view where the user navigates.

Application_PreNavigate (DestViewName, DestBusObjName)

Application_Start Event

Called when the Siebel client starts.

Application_Start(commandLine)

Business Component Methods for Siebel eScript

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

Table Summary of Business Component Methods for Siebel eScript

Method Description Format

ActivateField Method for a Business Component

Activates a field.

var myBusComp;

myBusComp.ActivateField(fieldName);

ActivateMultipleFields Method for a Business Component

Activates multiple fields.

var myBusComp;

myBusComp.ActivateMultipleFields(oPr opSet);

Associate Method for a Business Component

Creates a new many-to-many relationship for the parent object through an association business component.

var myBusComp;

myBusComp.Associate(whereIndicator);

BusObject Method for a Business Component

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

var myBusComp;

var busObject;

busObject = myBusComp.BusObject();

ClearToQuery Method for a Business Component

Clears the current query but does not clear sort specifications on a business component.

var myBusComp;

myBusComp.ClearToQuery();

DeactivateFields Method for a Business Component

Deactivates the fields that are currently active from the SQL query statement of a business component.

var myBusComp;

myBusComp.DeactivateFields();

DeleteRecord Method for a Business Component

Removes the current record from a business component.

var myBusComp;

myBusComp.DeleteRecord();

ExecuteQuery Method for a Business Component

Returns a set of business component records.

var myBusComp;

myBusComp.ExecuteQuery(cursorMode);

ExecuteQuery2 Method for a Business Component

Returns a set of business component records. Allows you to control the number of records Siebel CRM returns.

var myBusComp;

myBusComp.ExecuteQuery2(cursorMode, ignoreMaxCursorSize);

FirstRecord Method for a Business Component

Moves the record pointer to the first record in a business component, making that record the current record.

var myBusComp;

var bIsRecord;

bIsRecord = myBusComp.FirstRecord();

FirstSelected Method for a Business Component

Makes the first record of the multiple selection in a business component active.

var myBusComp;

var bIsMultipleSelection;

bIsMultipleSelection = myBusComp.FirstSelected();

GetAssocBusComp Method for a Business Component

Returns the name of the association business component.

var myBusComp;

var AssocBusComp;

AssocBusComp = myBusComp.GetAssocBusComp();

GetFieldValue Method for a Business Component

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

var myBusComp;

var sValue;

sValue = myBusComp.GetFieldValue(FieldName);

GetFormattedFieldValue Method for a Business Component

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

var myBusComp;

var sValue;

sValue = myBusComp.GetFormattedFieldValue(FieldName);

GetMultipleFieldValues Method for a Business Component

Returns a value for each field specified in a property set.

var myBusComp;

myBusComp.GetMultipleFieldValues (oFields, oValues );

GetMVGBusComp Method for a Business Component

Returns the multivalue group business component that is associated a business component field.

var myBusComp;

var MvgBusComp;

MvgBusComp= myBusComp.GetMVGBusComp(FieldName);

GetNamedSearch Method for a Business Component

Returns the name of a search specification.

var myBusComp;

var sValue;

sValue = myBusComp.GetNamedSearch(SearchName);

GetPicklistBusComp Method for a Business Component

Returns the name of the pick business component that is associated with a field in the current business component.

var myBusComp;

var pickBusComp;

pickBusComp = myBusComp.GetPicklistBusComp (FieldName);

GetSearchExpr Method for a Business Component

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

var myBusComp;

var sExpr;

sExpr = myBusComp.GetSearchExpr();

GetSearchSpec Method for a Business Component

Returns the search specification that is defined for a business component.

var myBusComp;

var sSpec;

sSpec = myBusComp.GetSearchSpec(FieldName);

GetSortSpec Method for a Business Component

Returns the sort specification for a business component.

var sSortSpec = this.GetSortSpec();

GetUserProperty Method for a Business Component

Returns the value of a user property.

var myBusComp;

var sValue;

sValue = myBusComp.GetUserProperty (propertyName);

GetViewMode Method for a Business Component

Returns the visibility mode for a business component.

var myBusComp;

var iMode;

iMode = myBusComp.GetViewMode();

InvokeMethod Method for a Business Component

Calls a method.

var myBusComp;

var sReturn;

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

LastRecord Method for a Business Component

Moves the record pointer to the last record in a business component.

var myBusComp;

var iReturn;

iReturn = myBusComp.LastRecord();

Name Method for a Business Component

Returns the name of a business component.

var myBusComp;

var sName;

sName = myBusComp.Name();

NewRecord Method for a Business Component

Adds a new record to a business component.

var myBusComp;

myBusComp.NewRecord(whereIndicator);

NextRecord Method for a Business Component

Moves the record pointer to the next record in a business component, making that record the current record.

var myBusComp;

var bFound;

bFound = myBusComp.NextRecord();

NextSelected Method for a Business Component

Makes the next record of the current multiple selection the active record.

var myBusComp;

var iReturn;

iReturn = myBusComp.NextSelected();

ParentBusComp Method for a Business Component

Returns the name of a parent business component.

var myBusComp;

var parentBusComp;

parentBusComp = myBusComp.ParentBusComp();

Pick Method for a Business Component

Places the currently chosen record in a pick business component into the appropriate fields of the parent business component.

var myBusComp;

myBusComp.Pick();

PreviousRecord Method for a Business Component

Moves the record pointer to the previous record in a business component, making that record the current record.

var myBusComp;

var iReturn;

iReturn = myBusComp.PreviousRecord();

RefineQuery Method for a Business Component

Refines a query.

var myBusComp;

myBusComp.RefineQuery();

SetFieldValue Method for a Business Component

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

var myBusComp;

myBusComp.SetFieldValue(FieldName, FieldValue);

SetFormattedFieldValue Method for a Business Component

Sets a new value in a field in the current record of a business component. It accepts the field value in the current local format.

var myBusComp;

myBusComp.SetFormattedFieldValue (FieldName, FieldValue);

SetMultipleFieldValues Method for a Business Component

Sets new values in the fields of the current record of a business component.

var myBusComp;

myBusComp.SetMultipleFieldValues (oPropSet);

SetNamedSearch Method for a Business Component

Sets a named search specification on a business component.

var myBusComp;

myBusComp.SetNamedSearch(searchName, searchSpec);

SetSearchExpr Method for a Business Component

Sets a search expression for a business component.

var myBusComp;

myBusComp.SetSearchExpr(searchSpec);

SetSearchSpec Method for a Business Component

Sets the search specification for a business component.

var myBusComp;

myBusComp.SetSearchSpec(FieldName, searchSpec);

SetSortSpec Method for a Business Component

Sets the sort specification for a business component.

var myBusComp;

myBusComp.SetSortSpec(sortSpec);

SetUserProperty Method for a Business Component

Sets the value of a user property in a business component.

var myBusComp;

myBusComp.SetUserProperty (propertyName, newValue);

SetViewMode Method for a Business Component

Sets the visibility type for a business component.

var myBusComp;

myBusComp.SetViewMode(viewMode);

UndoRecord Method for a Business Component

Reverses any unsaved modifications made to the record.

var myBusComp;

myBusComp.UndoRecord();

WriteRecord Method for a Business Component

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

var myBusComp;

myBusComp.WriteRecord();

Business Component Events for Siebel eScript

The following table describes a summary of business component events you can use with Siebel eScript.

Table Summary of Business Component Events for Siebel eScript

Event Description Format

BusComp_Associate Event

Called if the user adds a business component record to create an association.

BusComp_Associate()

BusComp_ChangeRecord Event

Called if a business component record becomes the current record.

BusComp_ChangeRecord()

BusComp_CopyRecord Event

Called if the user copies a business component record, and if the user makes this record the active record.

BusComp_CopyRecord()

BusComp_DeleteRecord Event

Called if the user deletes a business component record.

BusComp_DeleteRecord()

BusComp_InvokeMethod Event

Called if Siebel CRM calls the InvokeMethod method on a business component.

BusComp_InvokeMethod(methodName)

BusComp_NewRecord Event

Called if the user creates a business component record, and if the user makes this record the active record. You can use this event to set up default values for a field.

BusComp_NewRecord()

BusComp_PreAssociate Event

Called if Siebel CRM detects that the user is about to add a business component record to create an association.

BusComp_PreAssociate()

BusComp_PreCopyRecord Event

Called if Siebel CRM detects that the user is about to copy a business component record. You can use this event to perform precopy validation.

BusComp_PreCopyRecord()

BusComp_PreDeleteRecord Event

Called if Siebel CRM detects that the user is about to delete a business component record. You can use this event to prevent the deletion or to perform any actions before Siebel CRM deletes the record.

BusComp_PreDeleteRecord()

BusComp_PreGetFieldValue Event

Called if a user accesses a business component field.

BusComp_PreGetFieldValue(FieldName, &FieldValue)

Bus Comp_PreInvokeMethod Event

Called if Siebel CRM calls a specialized method on a business component. Siebel CRM calls it before it calls this specialized method.

BusComp_PreInvokeMethod(methodName)

BusComp_PreNewRecord Event

Called if Siebel CRM detects that the user is about to create a new business component record. You can use this event to perform preinsert validation.

BusComp_PreNewRecord()

BusComp_PreQuery Event

Siebel CRM calls the BusComp_PreQuery event before it runs a query. You can use this event to modify the search criteria or to restrict Siebel CRM from running certain queries.

BusComp_PreQuery()

BusComp_PreSetFieldValue Event

Siebel CRM calls this event after the user modifies a field value or after a call to the SetFieldValue method occurs. This event allows you to use custom validation before Siebel CRM applies predefined validation.

BusComp_PreSetFieldValue(FieldName, FieldValue)

BusComp_PreWriteRecord Event

Called before Siebel CRM writes a record to the Siebel database.

BusComp_PreWriteRecord()

BusComp_Query Event

Called after Siebel CRM completes a query but before it displays the query results.

BusComp_Query()

BusComp_SetFieldValue Event

Called if Siebel CRM sends a value to a business component from the Siebel client or through a call to the SetFieldValue method.

BusComp_SetFieldValue(FieldName)

BusComp_WriteRecord Event

Called after Siebel CRM saves the record to the Siebel database.

BusComp_WriteRecord()

Business Object Methods for Siebel eScript

The following table describes a summary of business object methods you can use with Siebel eScript.

Table Summary of Business Object Methods for Siebel eScript

Method Description Format

GetBusComp Method for a Business Object

Returns the name of a business component instance.

var myBusObject;

var myBusComp;

myBusComp = myBusObject.GetBusComp(BusCompName);

Name Method for a Business Object

Returns the name of a business object.

var myBusObject as BusObject;

var sName;

sName = myBusObject.Name();

Business Service Methods for Siebel eScript

The following table describes a summary of business service methods you can use with Siebel eScript.

Table Summary of Business Service Methods for Siebel eScript

Method Description Format

GetFirstProperty Method for a Business Service

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

var oService;

var sName;

sName = oService.GetFirstProperty();

GetNextProperty Method for a Business Service

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

var oService;

var sName;

sName = oService.GetNextProperty();

GetProperty Method for a Business Service

Returns the value of a property.

var oService;

var sValue;

sValue = oService.GetProperty(propName);

Name Method for a Business Service

Returns the name of a business service.

var oService;

var sName;

sName = oService.Name();

InvokeMethod Method for a Business Service

Calls a method.

var oService;

oService.InvokeMethod(methodName, InputArguments, OutputArguments);

PropertyExists Method for a Business Service

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

var oService;

var propExists;

propExists = oService.PropertyExists(propName);

RemoveProperty Method for a Business Service

Removes a property from a business service.

var oService;

oService.RemoveProperty(propName);

SetProperty Method for a Business Service

Sets a value for a property of a business service.

var oService;

oService.SetProperty(propName,propValue);

Business Service Events for Siebel eScript

The following table describes a summary of business service events you can use with Siebel eScript.

Table Summary of Business Service Events for Siebel eScript

Method Description Format

Service_InvokeMethod Event

Siebel CRM calls this event after it calls the InvokeMethod method.

Service_InvokeMethod(methodName)

Service_PreCanInvokeMethod Event

Siebel CRM calls this event before it calls the PreInvokeMethod event. This configuration allows you to determine if the user possesses the authority to call the business service method.

Service_PreCanInvokeMethod(MethodName, &CanInvoke)

Service_PreInvokeMethod Event

Siebel CRM calls this event before it calls a specialized method on a business service.

Service_PreInvokeMethod(methodName, Inputs, Outputs)

Property Set Methods for Siebel eScript

The following table describes a summary of property set methods you can use with Siebel eScript.

Table Summary of Property Set Methods for Siebel eScript

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 sPropVal;

sPropVal = 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 sPropVal

sPropVal = oPropSet.GetProperty(propName);

GetPropertyCount Method for a Property Set

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

var count;

count = oPropSet.GetPropertyCount();

GetType Method for a Property Set

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

var oPropSet;

var sTypeVal

sTypeVal = oPropSet.GetType(value);

GetValue Method for a Property Set

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

var oPropSet;

var sValVal;

sValVal = oPropSet.GetValue(value);

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.

Dim oService as SiebelService

Dim propExists as Boolean

propExists = oService.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);

Miscellaneous Methods for Siebel eScript

The following table describes a summary of miscellaneous methods you can use with Siebel eScript.

Table Summary of Miscellaneous Methods for Siebel eScript

Method Description Format

TheApplication Method

Returns the name of the application object.

TheApplication().Application_method;