Application_PreInvokeMethod Event

Siebel CRM calls the Application_PreInvokeMethod event before one of the following items calls a specialized method:

  • A custom applet menu that you define

  • The InvokeMethod method

This method returns ContinueOperation or CancelOperation. For more information, see Caution About Using the Cancel Operation Event Handler.

For more information about this method, see About Specialized and Custom Methods and Customizing the Outcome of an Object Interface Event.

Browser Script Format

Application_PreInvokeMethod (methodName, inputPropSet)

The arguments you use with this format are the same as the arguments described in Applet_InvokeMethod Event.

Server Script Format

Application_PreInvokeMethod(methodName)

The arguments you use with this format are the same as the arguments described in Applet_InvokeMethod Event, except that there is no inputPropSet argument.

Usage

If the method you instruct Siebel CRM to call is part of an If statement, then you must set the return value for the PreInvokeMethod before the End If statement. The following code is an example of this usage:

If MethodName = "ResetQuery" then
   Application_PreInvokeMethod = CancelOperation
End If

Used With

Browser Script, Server Script

Examples

The following example is in Siebel VB:

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\Office\WINWORD.EXE",1)
         iReturn = CancelOperation

      Case "LaunchExcel"
         i = Shell("C:\Program Files\Microsoft Office\Office\EXCEL.EXE",1)
         iReturn = CancelOperation
   End Select
   
   Application_PreInvokeMethod = iReturn

End Function

The following is the equivalent example in Siebel eScript. Note that for this script to run, the entire Clib.system statement must reside 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);
}