WebApplet_PreCanInvokeMethod Event

The WebApplet_PreCanInvokeMethod event allows a script to determine if the user possesses the authority to call the applet method. Siebel CRM calls this method in the following situations:

  • Before it calls the PreInvokeMethod event.

  • If the user steps to a different record.

  • If it loads an applet.

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

Format

WebApplet_PreCanInvokeMethod(MethodName, &CanInvoke)

The following table describes the arguments for the WebApplet_PreCanInvokeMethod event.

Argument Description

MethodName

A string that contains the name of the method that Siebel CRM must run.

&CanInvoke

A string that indicates if Siebel CRM call the applet method. You can use the following values:

  • TRUE. Siebel CRM can call the applet method.

  • FALSE. Siebel CRM cannot call the applet method.

Usage

Using the FirstSelected business component method with the PreCanInvokeMethod event can cause unexpected behavior in a pick applet that Siebel CRM calls from the applet where this event is called.

To enable and disable a method, it can be easier to use the CanInvokeMethod applet user property at the applet level. For an example, see Using a MiniButton Control to Call a Custom Method. For information about the CanInvokeMethod user property, see Siebel Developer's Reference.

Used With

Server Script

Examples

The following example is in Siebel eScript:

function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)
{
   if ( MethodName == "CustomMethod" )
   {
      CanInvoke = "TRUE";
      return( CancelOperation );
   }
   return (ContinueOperation);
}

The following example is in Siebel VB:

Function WebApplet_PreCanInvokeMethod (MethodName As String, CanInvoke As String) 
As Integer
   Dim iReturn As Integer
   iReturn = ContinueOperation
   If MethodName = "Test" Then
      CanInvoke = "TRUE"
      iReturn = CancelOperation
   End If
   WebApplet_PreCanInvokeMethod = iReturn
End Function