Siebel Object Interfaces Reference > Interfaces Reference > Applet Events >

WebApplet_PreInvokeMethod Event

The PreInvokeMethod event is called before a specialized method for the Web applet is invoked or a user-defined method is invoked through oWebApplet.InvokeMethod.





String variable or literal containing the name of the method invoked


"ContinueOperation" or "CancelOperation"


The PreInvokeMethod event is called just before a specialized method is invoked on the Web applet. If implementing a new method (not defined by the built-in functions), the script should return CancelOperation to avoid invoking an "Unknown Method Name" error.

CancelOperation does not stop the execution of the code following it, but it does prevent the execution of any built-in code associated with this event. WebApplet_PreInvokeMethod should return CancelOperation when you are handling the event entirely through scripting and you do not want the built-in code to execute. However, if there is code in the same script following CancelOperation, that code runs regardless of the CancelOperation.

Used With

Server Script


The following example is in Siebel eScript:

function WebApplet_PreInvokeMethod (MethodName)
   switch (MethodName)
   case "CustomMethod":
      var applet = this;
      var BC = applet.BusComp();
      var ConId = BC.GetFieldValue("Contact Id");
      var WshShell = COMCreateObject("WScript.Shell");
      WshShell.Popup("My Custom Method was called. Here is the ID " + ConId);
   return (ContinueOperation);

The following example is in Siebel VB:

Function WebApplet_PreInvokeMethod (MethodName As String) As Integer
   Dim iReturn As Integer
   iReturn = ContinueOperation
   Select Case MethodName
   Case "CustomMethod"
      Dim oBusComp As BusComp
      Set oBusComp = Me.BusComp
      Dim WshShell As Object
      ConId = oBusComp.GetFieldValue("Contact Id")
      Set WshShell = CreateObject("WScript.Shell")
      WshShell.Popup("My Custom Method was called. Here is the ID " & ConId)
      iReturn = CancelOperation
   End Select
   WebApplet_PreInvokeMethod = iReturn
End Function

Siebel Object Interfaces Reference