Siebel Object Interfaces Reference > Interfaces Reference > Applet Events >

WebApplet_PreCanInvokeMethod Event


The PreCanInvokeMethod event is called under the following conditions, allowing the script to determine whether or not the user has the authority to invoke the applet method:

  • Before the PreInvokeMethod event is called
  • When the user steps to a different record
  • When an applet is loaded
  • When a different method, such as GetProfileAttr() or SetProfileAttr(), is called from Browser Script

NOTE:  It is often easier to enable and disable methods at the applet level declaratively, using the CanInvokeMethod applet user property. For an example of this, see Invoking Custom Methods with MiniButton Controls. For more information on the CanInvokeMethod user property, see Siebel Developer's Reference.

Syntax

WebApplet_PreCanInvokeMethod(MethodName, &CanInvoke)

Argument
Description

MethodName

A string representing the name of the method to be executed.

&CanInvoke

A string representing whether or not the Applet method can be invoked. Valid values are TRUE or FALSE.

NOTE:  Using the FirstSelected business component method with the PreCanInvokeMethod event can cause unexpected behavior in pick applets invoked from the applet where this event is called.

Returns

CancelOperation or ContinueOperation

Used With

Server Script

Example

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

Siebel Object Interfaces Reference Copyright © 2008, Oracle. All rights reserved.