Bookshelf Home | Contents | Index | Search | PDF |
Siebel Object Interfaces Reference > Interfaces Reference > Application Events >
Application_PreInvokeMethod
The PreInvokeMethod event is called before a specialized method is invoked by a user-defined applet menu or by calling InvokeMethod on the application.
Server Script Syntax
Application_PreInvokeMethod(methodName)
Argument Description methodName String variable or literal containing the name of the method invokedBrowser Script Syntax
Application_PreInvokeMethod (methodName, inputPropSet)
Argument Description methodName String variable or literal containing the name of the method invoked. inputPropSet A property set containing parameters to be passed to the event.Returns
"ContinueOperation" or "CancelOperation"
Usage
The PreInvokeMethod event is called just before a specialized method is invoked on the application. If implementing a user-defined method, the script should return CancelOperation if you wish to handle the event entirely through your own scripting.
Specialized methods are methods based on applet or business component classes other than CSSFrame and CSSBusComp, respectively, that is, specialized classes.
When the method to be invoked is part of an If statement, this function's return value must be assigned before the End If statement, as in the following code fragment:
If MethodName = "ResetQuery" then
Application_PreInvokeMethod = CancelOperation
End IfCancelOperation stops the execution of the underlying Siebel code associated with the event. However, if there is code in the same script following CancelOperation, that code runs regardless of the CancelOperation.
Used With
Browser Script, Server Script
Example
Here is a sample implementation of the PreInvokeMethod:
Function Application_PreInvokeMethod (MethodName _
As String) As IntegerDim i As Integer
Dim iReturn As Integer
iReturn = ContinueOperation
Select Case MethodName
Case "LaunchWord"
i = Shell("C:\Program Files\Microsoft Office _
\Office\WINWORD.EXE",1)
iReturn = CancelOperationCase "LaunchExcel"
i = Shell("C:\Program Files\Microsoft Office _
\Office\EXCEL.EXE",1)
iReturn = CancelOperation
End Select
Application_PreInvokeMethod = iReturn
End FunctionHere is the equivalent sample in Siebel eScript. Note that for this script to run, the entire Clib.system statement must appear on a single line in the Editor.
function Application_PreInvokeMethod (MethodName)
var iReturn = ContinueOperation;
switch (MethodName)
{
case "LaunchWord":
Clib.system("\"C:\\Program Files\\Microsoft Office
\\Office\\WINWORD.EXE"",1);
iReturn = CancelOperation;
break;case "LaunchExcel":
Clib.system("\"C:\\Program Files\\Microsoft Office
\\Office\\EXCEL.EXE"",1);
iReturn = CancelOperation;
}
return (iReturn)
}See Also
Bookshelf Home | Contents | Index | Search | PDF |
Siebel Object Interfaces Reference Published: 18 June 2003 |