InvokeMethod Method for an Applet

The InvokeMethod method calls a specialized method. It returns the following:

  • In Server Script, returns a string that contains the result of the method.

  • In Browser Script, returns a property set.

Browser Script Format

Applet.InvokeMethod(methodName, methodArgs_PropSet);

The following table describes the arguments for the Browser Script format of the InvokeMethod method.

Argument Description

methodName

The name of the method.

methodArgs_PropSet

Property set that contains the method arguments.

Server Script Format

Applet.InvokeMethod(methodName, methArg1, methArg2, methArgN);

The following table describes the arguments for the Server Script format of the InvokeMethod method.

Argument Description

methodName

The name of the method.

You can use the following arguments:

  • methArg1

  • methArg2

  • methArgN

One or more strings that contain arguments for the methodName argument.

Usage

Available with Server Script and Browser Script. Note the following:

  • If the method that the methodName argument identifies exists in the browser, then Siebel CRM runs this method in the browser.

  • If the method that the methodName argument identifies exists on the Siebel Server, then Siebel CRM runs this method on the Siebel Server.

Caution About Using the InvokeMethod Method

You must use InvokeMethod only to call a method that this book describes.

Used With

Browser Script, Server Script

Examples

The following example is in Siebel eScript:

function WebApplet_PreInvokeMethod (MethodName)
{
   //Call a Siebel SmartScript from a custom button
   //using the applet.InvokeMethod method
   //Note the InvokeSScriptFromButton is from a custom
   //method added to a button
   if (MethodName == "InvokeSScriptFromButton")
   {
      var iReturn = ContinueOperation;
      var sArgs = new Array(3);
      sArgs[0] = "Demo Opportunity Profile";
      sArgs[1] = "";
      sArgs[2] = "";
      this.InvokeMethod("RunCallScript", sArgs);
      iReturn = CancelOperation;
   }
   else
   {
      iReturn = ContinueOperation;
   }
   return(iReturn);
}