You are on page 1of 16

Applet Methods for eScript

Table 69 lists a summary of the Applet methods' syntax.


Table 69. Applet Methods Syntax Summary

Method
Description
Syntax

BusComp Method
Returns the business component that is associated with the applet.
var applet;
var myBusComp;
myBusComp = applet.BusComp();

BusObject Method
Returns the business object for the business component for the applet.
var applet;
var busObject;
busObject = applet.BusObject();

InvokeMethod Method
Calls an argument-specified specialized method.
var applet;
applet.InvokeMethod(methodName, methodArg1, methodArg2, ..., methodArgn);

Name Method
Returns the name of the applet.
var applet;
var sApplet;
sApplet = applet.Name();
Table 70 lists a summary of the WebApplet Events.
Table 70. WebApplet Events Summary

Event
Description
Syntax

WebApplet_InvokeMethod Event
Called after a specialized method or a user-defined method on the Web applet has been executed.
WebApplet_InvokeMethod(MethodName);

WebApplet_Load Event
Called just after the Web applet is loaded.
WebApplet_Load

WebApplet_PreCanInvokeMethod Event
Called before the PreInvokeMethod, allowing the developer to determine whether the user has the
authority to invoke the applet method.
WebApplet_PreCanInvokeMethod(MethodName, &CanInvoke);

WebApplet_PreInvokeMethod Event
Called before a specialized method for the Web applet is invoked or a user-defined method is invoked
through oWebApplet.InvokeMethod.
WebApplet_PreInvokeMethod(MethodName);

WebApplet_ShowControl Event
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.
WebApplet_ShowControl (controlName, property, mode, &HTML);

WebApplet_ShowListColumn Event
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.
WebApplet_ShowListColumn (columnName, property, mode, &HTML);
Application Methods for eScript
Table 71 lists a summary of the Application methods' syntax.
Table 71. Application Methods Syntax Summary

Method
Description
Syntax

ActiveBusObject Method
Returns the business object for the business component for the active applet.
var busObject;
busObject = TheApplication().ActiveBusObject();

ActiveViewName Method
Returns the name of the active view.
var sView;
sView = TheApplication().ActiveViewName();

CurrencyCode Method
Returns the three-letter operating currency code.
var sCur;
sCur = TheApplication().CurrencyCode();

GetBusObject Method
Instantiates and returns a new instance of the business object specified in the argument.
var myBusObject;
myBusObject = TheApplication().GetBusObject( BusObjectName);

Name Method
Returns the name of the application.
var name;
name = TheApplication().Name();

GetService Method
Instantiates and returns a new instance of the service specified in the argument.
var Service;
Service = TheApplication().GetService(serviceName);

GetSharedGlobal Method
Business Component Methods for eScript
Table 73 lists a summary of the Business Component methods' syntax.
myBusComp.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 myBusComp;
myBusComp.SetFormattedFieldValue(FieldName, FieldValue);

SetMultipleFieldValues Method
Assigns a new value to the fields specified in the property set for the current row of the business
component.
var myBusComp;
myBusComp.SetMultipleFieldValues(oPropSet);

SetNamedSearch Method
Sets a named search specification on the business component.
var myBusComp;
myBusComp.SetNamedSearch(searchName, searchSpec);

SetSearchExpr Method
Sets the search specification for the business component.
var myBusComp;
myBusComp.SetSearchExpr(searchSpec);

SetSearchSpec Method
Sets the search specification for the specified field.
var myBusComp;
myBusComp.SetSearchSpec(FieldName, searchSpec);

SetSortSpec Method
Sets the sort specification for a query.
var myBusComp;
myBusComp.SetSortSpec(sortSpec);

SetUserProperty Method
Sets the value of the specified User Property.
var myBusComp;
myBusComp.SetUserProperty(propertyName, newValue);
Business Object Methods for eScript
Table 75 lists a summary of the Business Object methods' syntax.

Table 75. Business Object Methods Syntax Summary

Method
Description
Syntax

GetBusComp Method
Returns the specified business component.
var myBusObject;
var myBusComp;
myBusComp = myBusObject.GetBusComp(BusCompName);

Name Method
Returns the name of the business object.
var myBusObject as BusObject;
var sName;
sName = myBusObject.Name();
Business Service Methods for eScript
Table 76 lists a summary of the Business Service methods' syntax.
Table 76. Business Service Methods Syntax Summary

Method
Description
Syntax

GetFirstProperty Method
Retrieves the name of the first property of a business service.
var oService;
var sName;sName = oService.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 oService;
var sName;
sName = oService.GetNextProperty();

GetProperty Method
Retrieves the value stored in the specified property.
var oService;
var sValue;
sValue = oService.GetProperty(propName);

Name Method
Returns the name of the business service.
var oService;
var sName;
sName = oService.Name();

InvokeMethod Method
Calls a specialized method or a user-created method on the business service.
var oService;
oService.InvokeMethod(methodName, InputArguments, OutputArguments);

PropertyExists Method
Returns a Boolean value indicating whether the property specified in the argument exists.
var oService;
var propExists;
propExists = oService.PropertyExists( propName);
PropertySet Methods for eScript
Table 78 lists a summary of the PropertySet methods' syntax.
Table 78. PropertySet Methods Syntax Summary

Method
Description
Syntax

AddChild Method
Adds subsidiary property sets to a property set.
var oPropSet;
var iIndex;
iIndex = oPropSet.AddChild( childObject);

Copy Method
Returns a copy of a property set.
var oPropSet1;
var oPropSet2;
oPropSet2 = oPropSet1.Copy();

GetChild Method
Returns a specified child property set of a property set.
var oPropSet;
var sPropVal;
sPropVal = oPropSet.GetChild(index);

GetChildCount Method
Returns the number of child property sets attached to a parent property set.
var oPropSet;
var iCount;
iCount = oPropSet.GetChildCount();

GetFirstProperty Method
Returns the name of the first property in a property set.
var oPropSet;
var sPropName;
sPropName = oPropSet.GetFirstProperty();

GetNextProperty Method
Returns the name of the next property in a property set.
var oPropSet;
var sPropName
Bookshelf Home | Contents | Index | PDF

Miscellaneous Methods for eScript


Table 79 lists a summary of the Miscellaneous Method syntax.

Table 79. Miscellaneous Method Syntax Summary

Method
Description
Syntax

TheApplication Method
Global method that returns the unique object of type Application.
TheApplication().Application_method;
Invoking Custom Methods with MiniButtons
Be sure to set up Tools for the appropriate Target Browser Group.

To invoke a custom method with a MiniButton

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

2. Right click the Applet and choose Edit Web Layout.

The Web layout editor appears.

3. Change the template mode on the Web Controls toolbar to 3: Edit List.

A window opens with the available controls, including the one you just created.

4. Drag and drop the control the ButtonTest control onto an available location. When you release the
mouse button, the button appears.

5. Click Save and then choose File > Close.

6. To add a server script to the applet that enables the button, right-click the applet and choose Edit
Server Scripts. Add the following script to the WebApplet_PreCanInvokeMethod() function.

function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)


{
if ( MethodName == "MyTest" )
{
CanInvoke = "TRUE";
return( CancelOperation );
}
return (ContinueOperation);
}

7. 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":
alert( "Siebel 7 browser script!" );
return("CancelOperation");
break;
}
return ("ContinueOperation");
}

8. Run any application that has access to accounts, and go to the Accounts screen.
The new button should appear.

9. Click Test.

The Browser Script should display an alert box indicating "Siebel 7 Browser Script!"

Siebel Object Interfaces Reference