Siebel Object Interfaces Reference > Interfaces Reference > Application Events >

Application_PreInvokeMethod Event

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




String variable or literal containing the name of the method invoked

Browser Script Syntax

Application_PreInvokeMethod (methodName, inputPropSet)



String variable or literal containing the name of the method invoked.


A property set containing arguments to be passed to the event.


"ContinueOperation" or "CancelOperation"


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 If

CancelOperation 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


The following example is in Siebel VB and shows an implementation of the PreInvokeMethod:

Function Application_PreInvokeMethod (MethodName _
         As String) As Integer

   Dim i As Integer
   Dim iReturn As Integer
   iReturn = ContinueOperation
   Select Case MethodName
      Case "LaunchWord"
         i = Shell("C:\Program Files\Microsoft Office _
         iReturn = CancelOperation

      Case "LaunchExcel"
         i = Shell("C:\Program Files\Microsoft Office _
         iReturn = CancelOperation
   End Select
   Application_PreInvokeMethod = iReturn

End Function

The following 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
         iReturn = CancelOperation;

      case "LaunchExcel":
         Clib.system("\"C:\\Program Files\\Microsoft Office
         iReturn = CancelOperation;
   return (iReturn)

See Also

How Your Script Affects Program Flow

Siebel Object Interfaces Reference