Vous êtes sur la page 1sur 18

13 Siebel eScript Quick Reference

This chapter provides a quick reference for Siebel eScript methods and events. It has the following topics: Applet Methods for eScript WebApplet Events for eScript on page 416 Application Methods for eScript on page 417 Application Events for eScript on page 419 Business Component Methods for eScript on page 420 Business Component Events for eScript on page 424 Business Object Methods for eScript on page 426 Business Service Methods for eScript on page 426 Business Service Events for eScript on page 427 Property Set Methods for eScript on page 428 Miscellaneous Methods for eScript on page 429

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.

Applet Methods for eScript


Table 84 lists a summary of the applet methods syntax. Table 84. Method BusComp Method BusObject Method Applet Methods Syntax Summary Description Returns the business component that is associated with the applet. Returns the business object for the business component for the applet. Syntax var applet; var myBusComp; myBusComp = applet.BusComp(); var applet; var busObject; busObject = applet.BusObject();

Siebel Object Interfaces Reference Version 8.0, Rev. B

41 5

Siebel eScript Quick Reference WebApplet Events for eScript

Table 84. Method

Applet Methods Syntax Summary Description Calls an argument-specified specialized method. Syntax var applet; applet.InvokeMethod(methodName,

InvokeMethod Method

methodArg1, methodArg2, , methodArgn);


Name Method Returns the name of the applet. var applet; var sApplet; sApplet = applet.Name();

WebApplet Events for eScript


Table 85 lists a summary of the WebApplet events. Table 85. Event WebApplet_InvokeMethod Event WebApplet Events Summary Description Called after a specialized method or a user-defined method on the Web applet has been executed. Called just after the Web applet is loaded. Called before the PreInvokeMethod, allowing the developer to determine whether the user has the authority to invoke the applet method. Called before a specialized method for the Web applet is invoked or a userdefined method is invoked through oWebApplet.InvokeMet hod. Syntax WebApplet_InvokeMethod (MethodName)

WebApplet_Load Event WebApplet_PreCanInvokeMethod Event

WebApplet_Load WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)

WebApplet_PreInvokeMethod Event

WebApplet_PreInvokeMethod (MethodName)

416

Siebel Object Interfaces Reference Version 8.0, Rev. B

Siebel eScript Quick Reference Application Methods for eScript

Table 85. Event

WebApplet Events Summary Description Allows scripts to modify the HTML generated by the Siebel Web Engine to render a control on a Web page in a Standard Activity application. Allows scripts to modify the HTML generated by the Siebel Web Engine to render a list column on a Web page in a Standard Activity application. Syntax WebApplet_ShowControl (controlName, property, mode, &HTML)

WebApplet_ShowControl Event

WebApplet_ShowListColumn Event

WebApplet_ShowListColumn (columnName, property, mode, &HTML)

Application Methods for eScript


Table 86 lists a summary of the application methods syntax. Table 86 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 143.

Table 86. Method

Application Methods Syntax Summary Description Returns the business object for the business component for the active applet. Returns the name of the active view. Returns the three-letter operating currency code. Instantiates and returns a new instance of the business object specified in the argument. Returns the name of the application. Syntax var busObject; busObject = TheApplication().ActiveBusObject(); var sView; sView = TheApplication().ActiveViewName(); var sCur; sCur = TheApplication().CurrencyCode(); var myBusObject; myBusObject = TheApplication().GetBusObject( BusObjectName); var name; name = TheApplication().Name();

ActiveBusObject Method ActiveViewName Method CurrencyCode Method GetBusObject Method

Name Method

Siebel Object Interfaces Reference Version 8.0, Rev. B

41 7

Siebel eScript Quick Reference Application Methods for eScript

Table 86. Method

Application Methods Syntax Summary Description Instantiates and returns a new instance of the service specified in the argument. Gets the shared user-defined global variables. Syntax var Service; Service = TheApplication().GetService (serviceName); var sName; sName = TheApplication().GetSharedGlobal (varName); TheApplication().GotoView( viewName[, BusinessObject]); TheApplication().InvokeMethod( methodName, methodArg1, methodArg2,..., methodArgn); var sID; sID = TheApplication().LoginId(); var sUser; sUser = TheApplication().LoginName(); var oPropSet; oPropSet = TheApplication().NewPropertySet(); var sRow; sRow = TheApplication().PositionId(); var sPosition; sPosition = TheApplication().PositionName(); var keyVal; var arg1 ...; TheApplication().RaiseError(keyVal, arg1, ); var message; TheApplication().RaiseErrorText (message); var success; success = TheApplication().SetPositionId (posId);

GetService Method

GetSharedGlobal Method

GotoView Method InvokeMethod Method LoginId Method

Activates the named view and its business object. Calls the named specialized method. Returns the login ID of the user who started the Siebel application. Returns the login name of the user who started Oracles Siebel application. Constructs and returns a new property set object. Returns the position ID that describes the users current position. Returns the position name of the users current position. Raises a scripting error message to the browser. The error code is a canonical number. Raises a scripting error message to the browser. The error text is the specified literal string. Sets the active position to the position ID specified in the argument.

LoginName Method

NewPropertySet Method PositionId Method

PositionName Method RaiseError Method

RaiseErrorText Method SetPositionId Method

418

Siebel Object Interfaces Reference Version 8.0, Rev. B

Siebel eScript Quick Reference Application Events for eScript

Table 86. Method

Application Methods Syntax Summary Description Sets the active position to the position name specified in the argument. Returns a Boolean value indicating whether the method succeeded. Used in personalization to assign values to attributes in a user profile. Sets a shared user-defined global variable. Appends a message to the trace file. Turns off the tracing started by TraceOn. Turns tracing on. Syntax var success; success = TheApplication().SetPositionName (posName);

SetPositionName Method

SetProfileAttr Method SetSharedGlobal Method Trace Method TraceOff Method TraceOn Method

TheApplication().SetProfileAttr (name, value); TheApplication().SetSharedGlobal (varName, value); TheApplication().Trace(message); TheApplication().TraceOff(); TheApplication().TraceOn(filename,

type, selection);

Application Events for eScript


Table 87 lists a summary of the application events. Table 87. Event Application_Close Event Application_InvokeMethod Event Application_Navigate Event Application_PreInvokeMethod Event Application_PreNavigate Event Application Events Syntax Summary Description Called before the application exits. Called after a specialized method is invoked. Called after the client has navigated to a view. Called before a specialized method is invoked. Called before the client has navigated from one view to the next. Called when the client starts. Syntax Application_Close() Application_InvokeMethod (methodName) Application_Navigate() Application_PreInvokeMethod (methodName) Application_PreNavigate (DestViewName, DestBusObjName) Application_Start(commandLine)

Application_Start Event

Siebel Object Interfaces Reference Version 8.0, Rev. B

41 9

Siebel eScript Quick Reference Business Component Methods for eScript

Business Component Methods for eScript


Table 88 lists a summary of the business component methods syntax. Table 88 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 216.

Table 88. Method

Business Component Methods Syntax Summary Description Allows queries to retrieve data for the specified field. Allows queries to retrieve data for the fields specified in the property set. Creates a new many-tomany relationship for the parent object through an association business component. Returns the business object that contains the business component. Clears the current query and sort specifications on the business component. Deactivates every currently activated field. Removes the current record from the business component. Retrieves a set of BusComp records. Retrieves a set of BusComp records. Moves to the first record in the business component. Syntax var myBusComp; myBusComp.ActivateField(fieldName); var myBusComp; myBusComp.ActivateMultipleFields(oPr opSet);

ActivateField Method

ActivateMultipleFields Method

Associate Method

var myBusComp; myBusComp.Associate(whereIndicator);

BusObject Method

var myBusComp; var busObject; busObject = myBusComp.BusObject(); var myBusComp; myBusComp.ClearToQuery(); var myBusComp; myBusComp.DeactivateFields(); var myBusComp; myBusComp.DeleteRecord(); var myBusComp; myBusComp.ExecuteQuery(cursorMode); var myBusComp; myBusComp.ExecuteQuery2(cursorMode, ignoreMaxCursorSize); var myBusComp; var bIsRecord; bIsRecord = myBusComp.FirstRecord();

ClearToQuery Method

DeactivateFields Method DeleteRecord Method

ExecuteQuery Method ExecuteQuery2 Method

FirstRecord Method

420

Siebel Object Interfaces Reference Version 8.0, Rev. B

Siebel eScript Quick Reference Business Component Methods for eScript

Table 88. Method

Business Component Methods Syntax Summary Description Moves to the first record of the multiple selection in the business component. Returns the association business component. Syntax var myBusComp; var bIsMultipleSelection; bIsMultipleSelection = myBusComp.FirstSelected(); var myBusComp; var AssocBusComp; AssocBusComp = myBusComp.GetAssocBusComp(); var myBusComp; var sValue; sValue = myBusComp.GetFieldValue(FieldName); var myBusComp; var sValue; sValue = myBusComp.GetFormattedFieldValue(Fie ldName); var myBusComp; myBusComp.GetMultipleFieldValues (oFields, oValues ); var myBusComp; var MvgBusComp; MvgBusComp= myBusComp.GetMVGBusComp(FieldName); var myBusComp; var sValue; sValue = myBusComp.GetNamedSearch(SearchName) ; var myBusComp; var pickBusComp; pickBusComp = myBusComp.GetPicklistBusComp (FieldName); var myBusComp; var sExpr; sExpr = myBusComp.GetSearchExpr(); var myBusComp; var sSpec; sSpec = myBusComp.GetSearchSpec(FieldName);

FirstSelected Method

GetAssocBusComp Method

GetFieldValue Method

Returns a value for the field specified in the argument. Returns a formatted value for the field specified in the argument.

GetFormattedFieldValue Method

GetMultipleFieldValues Method GetMVGBusComp Method

Returns a value for the fields specified in the property set. Returns the MVG business component associated with the field specified in the argument. Returns the named search specification specified in the argument.

GetNamedSearch Method

GetPicklistBusComp Method

Returns the pick business component associated with the field specified in the argument. Returns the current search expression. Returns the current search specification for the field specified in the argument.

GetSearchExpr Method

GetSearchSpec Method

Siebel Object Interfaces Reference Version 8.0, Rev. B

42 1

Siebel eScript Quick Reference Business Component Methods for eScript

Table 88. Method

Business Component Methods Syntax Summary Description Returns the active sort specification of the object that has context. Returns the value for a property name specified in the argument. Returns the visibility mode for the business component. Calls the specialized method named in the argument. Syntax var sSortSpec = this.GetSortSpec();

GetSortSpec Method

GetUserProperty Method

var myBusComp; var sValue; sValue = myBusComp.GetUserProperty (propertyName); var myBusComp; var iMode; iMode = myBusComp.GetViewMode(); var myBusComp; var sReturn; sReturn = myBusComp.InvokeMethod(methodName, methodArg1, methodArg2,..., methodArgn); var myBusComp; var iReturn; iReturn = myBusComp.LastRecord(); var myBusComp; var sName; sName = myBusComp.Name(); var myBusComp; myBusComp.NewRecord(whereIndicator); var myBusComp; var bFound; bFound = myBusComp.NextRecord(); var myBusComp; var iReturn; iReturn = myBusComp.NextSelected(); var myBusComp; var parentBusComp; parentBusComp = myBusComp.ParentBusComp(); var myBusComp; myBusComp.Pick();

GetViewMode Method

InvokeMethod Method

LastRecord Method

Moves to the last record in the business component. Returns the name of the business component. Adds a new record to the business component. Moves to the next record in the business component. Moves to the next record of the current multiple selection. Returns the parent business component.

Name Method

NewRecord Method NextRecord Method

NextSelected Method

ParentBusComp Method

Pick Method

Places the currently selected record in a picklist business component into the appropriate fields of the parent business component.

422

Siebel Object Interfaces Reference Version 8.0, Rev. B

Siebel eScript Quick Reference Business Component Methods for eScript

Table 88. Method

Business Component Methods Syntax Summary Description Moves to the previous record in the business component. Refines a query after a query has been executed. Assigns a new value to the named field for the current row of the business component. 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. Assigns a new value to the fields specified in the property set for the current row of the business component. Sets a named search specification on the business component. Sets the search specification for the business component. Sets the search specification for the specified field. Sets the sort specification for a query. Sets the value of the specified User Property. Sets the visibility type for the business component. Syntax var myBusComp; var iReturn; iReturn = myBusComp.PreviousRecord(); var myBusComp; myBusComp.RefineQuery(); var myBusComp; myBusComp.SetFieldValue(FieldName, FieldValue);

PreviousRecord Method

RefineQuery Method SetFieldValue Method

SetFormattedFieldValue Method

var myBusComp; myBusComp.SetFormattedFieldValue (FieldName, FieldValue);

SetMultipleFieldValues Method

var myBusComp; myBusComp.SetMultipleFieldValues (oPropSet);

SetNamedSearch Method

var myBusComp; myBusComp.SetNamedSearch(searchName, searchSpec); var myBusComp; myBusComp.SetSearchExpr(searchSpec); var myBusComp; myBusComp.SetSearchSpec(FieldName, searchSpec); var myBusComp; myBusComp.SetSortSpec(sortSpec); var myBusComp; myBusComp.SetUserProperty (propertyName, newValue); var myBusComp; myBusComp.SetViewMode(viewMode);

SetSearchExpr Method

SetSearchSpec Method

SetSortSpec Method SetUserProperty Method

SetViewMode Method

Siebel Object Interfaces Reference Version 8.0, Rev. B

42 3

Siebel eScript Quick Reference Business Component Events for eScript

Table 88. Method

Business Component Methods Syntax Summary Description Reverses any uncommitted changes made to the record. Commits to the database any changes made to the current record. Syntax var myBusComp; myBusComp.UndoRecord(); var myBusComp; myBusComp.WriteRecord();

UndoRecord Method

WriteRecord Method

Business Component Events for eScript


Table 89 lists a summary of the business component events. Table 89. Event BusComp_Associate Event Business Component Events Syntax Summary Description Called after a record is added to a business component to create an association. Called after the current row changes in the business component. Called after a new row is copied in the business component. Called after a row is deleted in the business component. Called after a specialized method is invoked in the business component. Called after a new row has been created and made active in the business component. Called before a record is added to a business component to create an association. Syntax BusComp_Associate()

BusComp_ChangeRecord Event BusComp_CopyRecord Event

BusComp_ChangeRecord()

BusComp_CopyRecord()

BusComp_DeleteRecord Event

BusComp_DeleteRecord()

BusComp_InvokeMethod Event BusComp_NewRecord Event

BusComp_InvokeMethod(methodName)

BusComp_NewRecord()

BusComp_PreAssociate Event

BusComp_PreAssociate()

424

Siebel Object Interfaces Reference Version 8.0, Rev. B

Siebel eScript Quick Reference Business Component Events for eScript

Table 89. Event

Business Component Events Syntax Summary Description Called before a new row is copied in the business component. Called before a row is deleted in the business component. Called when the value of the business component field is accessed. Called before a specialized method is invoked on a business component. Called before a new row is created in the business component. Called before query execution. Called before a value is pushed down into the business component from the user interface. Called before a row is written out to the database. Called after the query is complete and every row has been retrieved, but before they have been displayed. Called after a value has been pushed down into the business component from the user interface. Called after a row is written to the database. Syntax BusComp_PreCopyRecord()

BusComp_PreCopyRecord Event BusComp_PreDeleteRecord Event BusComp_PreGetFieldValue Event BusComp_PreInvokeMethod Event BusComp_PreNewRecord Event BusComp_PreQuery Event BusComp_PreSetFieldValue Event

BusComp_PreDeleteRecord()

BusComp_PreGetFieldValue (FieldName, &FieldValue) BusComp_PreInvokeMethod (methodName) BusComp_PreNewRecord()

BusComp_PreQuery() BusComp_PreSetFieldValue (FieldName, FieldValue)

BusComp_PreWriteRecord Event BusComp_Query Event

BusComp_PreWriteRecord()

BusComp_Query()

BusComp_SetFieldValue Event

BusComp_SetFieldValue(FieldName)

BusComp_WriteRecord Event

BusComp_WriteRecord()

Siebel Object Interfaces Reference Version 8.0, Rev. B

42 5

Siebel eScript Quick Reference Business Object Methods for eScript

Business Object Methods for eScript


Table 90 lists a summary of the business object methods syntax. Table 90. Method GetBusComp Method Business Object Methods Syntax Summary Description Returns the specified business component. Syntax var myBusObject; var myBusComp; myBusComp = myBusObject.GetBusComp(BusCompName); var myBusObject as BusObject; var sName; sName = myBusObject.Name();

Name Method

Returns the name of the business object.

Business Service Methods for eScript


Table 91 lists a summary of the business service methods syntax. Table 91. Method GetFirstProperty Method Business Service Methods Syntax Summary Description Retrieves the name of the first property of a business service. Syntax var oService; var sName; sName = oService.GetFirstProperty(); var oService; var sName; sName = oService.GetNextProperty();

GetNextProperty Method

After the name of the first property has been retrieved, retrieves the name of the next property of a business service. Retrieves the value stored in the specified property.

GetProperty Method

var oService; var sValue; sValue = oService.GetProperty(propName); var oService; var sName; sName = oService.Name(); var oService; oService.InvokeMethod(methodName, InputArguments, OutputArguments); var oService; var propExists; propExists = oService.PropertyExists( propName);

Name Method

Returns the name of the business service. Calls a specialized method or a user-created method on the business service. Returns a Boolean value indicating whether the property specified in the argument exists.

InvokeMethod Method PropertyExists Method

426

Siebel Object Interfaces Reference Version 8.0, Rev. B

Siebel eScript Quick Reference Business Service Events for eScript

Table 91. Method

Business Service Methods Syntax Summary Description Removes a property from a business service. Assigns a value to a property of a business service Syntax var oService; oService.RemoveProperty(propName); var oService; oService.SetProperty(propName, propValue);

RemoveProperty Method SetProperty Method

Business Service Events for eScript


Table 92 lists a summary of the business service events. Table 92. Method Service_InvokeMethod Event Business Service Events Syntax Summary Description Called after a method is invoked in a business service. Called before the PreInvokeMethod, allowing the developer to determine whether or not the user has the authority to invoke the business service method. Called before a specialized method is invoked on a business service. Syntax Service_InvokeMethod (methodName) Service_PreCanInvokeMethod (MethodName, &CanInvoke)

Service_PreCanInvokeMethod Event

Service_PreInvokeMethod Event

Service_PreInvokeMethod (methodName, Inputs, Outputs)

Siebel Object Interfaces Reference Version 8.0, Rev. B

42 7

Siebel eScript Quick Reference Property Set Methods for eScript

Property Set Methods for eScript


Table 93 lists a summary of the property set methods syntax. Table 93. Method AddChild Method Property Set Methods Syntax Summary Description Adds subsidiary property sets to a property set. Syntax var oPropSet; var iIndex; iIndex = oPropSet.AddChild( childObject); var oPropSet1; var oPropSet2; oPropSet2 = oPropSet1.Copy(); var oPropSet; var sPropVal; sPropVal = oPropSet.GetChild(index); var oPropSet; var iCount; iCount = oPropSet.GetChildCount(); var oPropSet; var sPropName; sPropName = oPropSet.GetFirstProperty(); var oPropSet; var sPropName sPropName = oPropSet.GetNextProperty(); var oPropSet; var sPropVal sPropVal = oPropSet.GetProperty(propName); var count; count = oPropSet.GetPropertyCount(); var oPropSet; var sTypeVal sTypeVal = oPropSet.GetType(value); var oPropSet; var sValVal; sValVal = oPropSet.GetValue(value); var oPropSet; oPropSet.InsertChildAt(childObject, index);

Copy Method

Returns a copy of a property set.

GetChild Method

Returns a specified child property set of a property set.

GetChildCount Method GetFirstProperty Method

Returns the number of child property sets attached to a parent property set. Returns the name of the first property in a property set.

GetNextProperty Method

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

GetProperty Method

Returns the value of a property when given the property name.

GetPropertyCount Method GetType Method

Returns the number of properties attached to a property set. Returns the value stored in a type in a property set. Returns a value stored as part of a property set. Inserts a child property set into a parent property set at a specific location.

GetValue Method

InsertChildAt Method

428

Siebel Object Interfaces Reference Version 8.0, Rev. B

Siebel eScript Quick Reference Miscellaneous Methods for eScript

Table 93. Method

Property Set Methods Syntax Summary Description Returns a Boolean value indicating whether the property specified in the argument exists. Removes a child property set as a specified index from a parent property set. Removes the property specified in its argument from a property set. Removes every property and child property set from a property set. Assigns a value to the property of a property set specified in its argument. Assigns a data value to a type member of a property set. Assigns a data value to a value member of a property set. Syntax Dim oService as SiebelService Dim propExists as Boolean propExists = oService.PropertyExists(propName) var oPropSet; oPropSet.RemoveChild(index); var oPropSet; oPropSet.RemoveProperty(propName); var oPropSet; oPropSet.Reset(); var oPropSet; oPropSet.SetProperty (propName, propValue); var oPropSet; oPropSet.SetType(value); var oPropSet; oPropSet.SetValue(value);

PropertyExists Method

RemoveChild Method

RemoveProperty Method Reset Method

SetProperty Method

SetType Method SetValue Method

Miscellaneous Methods for eScript


Table 94 lists a summary of the miscellaneous methods syntax. Table 94. Method TheApplication Method Miscellaneous Methods Syntax Summary Description Global method that returns the unique object of type Application. Syntax TheApplication().Application_

method;

Siebel Object Interfaces Reference Version 8.0, Rev. B

42 9

Siebel eScript Quick Reference Miscellaneous Methods for eScript

430

Siebel Object Interfaces Reference Version 8.0, Rev. B

14 Invoking Custom Methods with MiniButton Controls


This chapter provides a procedure to invoke a custom method with a MiniButton control.

Invoking Custom Methods with MiniButton Controls


Be sure to set the appropriate Target Browser Group in Siebel Tools.

To invoke a custom method with a MiniButton control 1


Choose an applet (for example, Account List Applet) and create a control with the following properties: Name = ButtonTest Caption = Test HTML Type = MiniButton Method Invoked = MyTest

Right click the applet and choose Edit Web Layout. The Web Layout Editor appears. The Controls/Columns window opens with the available controls, including the one you just created.

3 4 5 6

Change the template mode in the Controls/Columns window to 4: Edit List. Drag and drop the ButtonTest control onto an available location. When you release the mouse button, the button appears. Click Save, and then close the Web Layout Editor. Enable the button using one of the following methods:

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 CanInvokeMethod: MyTest Value TRUE

For more information on the CanInvokeMethod user property, see Siebel Developers Reference. NOTE: The declarative method is strongly recommended for performance reasons.

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.

Siebel Object Interfaces Reference Version 8.0, Rev. B

43 1

Invoking Custom Methods with MiniButton Controls Invoking Custom Methods with MiniButton Controls

function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke) { if (MethodName == "MyTest") { CanInvoke = "TRUE"; return(CancelOperation); } return(ContinueOperation); }

Add the following browser script to the applet you are using (for example, the Account List Applet): function Applet_PreInvokeMethod (name, inputPropSet) { switch (name) { case "MyTest": theApplication().SWEAlert("Browser script!"); return("CancelOperation"); break; } return("ContinueOperation"); }

8 9

Compile the applet object by right-clicking on it and then choosing Compile Selected Objects. Run any application that has access to accounts, and navigate to My Accounts. The new button appears.

10 Click Test.
The Browser Script displays an alert box indicating Browser Script!

432

Siebel Object Interfaces Reference Version 8.0, Rev. B

Vous aimerez peut-être aussi