Siebel Object Interfaces Reference > Interfaces Reference > Business Component Methods >

InvokeMethod Method


InvokeMethod calls the specialized method or user-created method named in the argument.

VB Syntax

BusComp.InvokeMethod methodName, methodArgs

Argument
Description

methodName

The name of the method. For more information on the available methods, read InvokeMethod Methods.

methodArgs

A single string or a string array (object interfaces) containing arguments to methodName.

eScript Syntax

BusComp.InvokeMethod(methodName, methArg1, methArg2, ..., methArgn);

Argument
Description

methodName

The name of the method

methArg1, methArg2, ..., methArgn

One or more strings containing arguments to methodName

Returns

In Server Script, returns a string containing the result of the method.

In Browser Script, returns a property set.

Usage

Use InvokeMethod to call methods on a business component object that are not exposed directly through the object interface.

Specialized methods are typically methods implemented in applet or business component classes other than CSSFrame and CSSBusComp, respectively, that is, specialized classes.

NOTE:  The InvokeMethod method should be used only with documented specialized methods. Siebel Systems does not support calling specialized methods with InvokeMethod, unless they are listed in this book.

Used With

COM Data Control, Java Data Bean, Mobile Web Client Automation Server, Server Script

Example

The following example is in Siebel VB:

(general) (declarations)
Option Explicit

Sub Button1_Click
Me.BusComp.InvokeMethod "Select All"
End Sub

Function BusComp_PreInvokeMethod (MethodName As String) As Integer
BusComp_PreInvokeMethod = ContinueOperation
On Error GoTo Leave
If MethodName = "Select All" Then
   Dim oCurBC as BusComp
   Set oCurBC = Me
   If oCurBC is not nothing Then
      oCurBC.ClearToQuery
      oCurBC.ExecuteQuery
      BusComp_PreInvokeMethod = CancelOperation
   End If
End If

Leave:
End Function

The following is the equivalent example in Siebel eScript.

function BusComp_PreInvokeMethod (MethodName)
{
   var iReturn = ContinueOperation;
   If (Clib.errno() != 0)
      return(CancelOperation);
   if (MethodName = "Select All")
   {
      var oCurBC = this;
      if (oCurBC != null)
      {
         oCurBC.ClearToQuery();
         oCurBC.ExecuteQuery();
         return(CancelOperation);
      }
   }
return (iReturn);
}

InvokeMethod Methods

Siebel applications provide multiple methods for manipulating files stored in the Siebel File System. These methods may be invoked using server script (Siebel VB, eScript) or using one of our programmatic interfaces (Mobile Web Client Automation Server - connected mode only, COM Data Control, Java Data Bean). The methods available for manipulating the file system always store or retrieve the file to and from the local file system. For example, if you construct a Java client using the Java Data Bean to manipulate the file system, all files must be accessible from the Siebel Server. You can use UNC naming conventions (for example: \\server\dir\file.txt) or standard DOS directories (for example: D:\dir\file.txt) for file access, but the UNC path or mounted file system must be accessible to the Siebel Server. These methods do not serialize the files from a remote client and place them in the Siebel file system.

Methods that manipulate files are available for business components whose Class is 'CSSBCFile'. The methods can be accessed using COM Data Control, Java Data Bean, Mobile Web Client Automation Server, and Server Script.

The following methods are available for use with InvokeMethod:

CreateFile

To create a file in the Siebel file system from an external source, use the business component CreateFile method. Before calling CreateFile, make sure that a new business component record has been created using the NewRecord method for the business component.

Syntax

BusComp.InvokeMethod("CreateFile", SrcFilePath, KeyField, keepLink)

Argument
Description

SrcFilePath

The fully qualified path of the file on the Siebel Server or Mobile Web Client.

KeyFieldName

The name of the field in the business component that contains the File Name. For example: AccntFileName field in the Account Attachment business component.

KeepLink

Applies to URLs. Either Y or N depending on whether a link to the file is stored as an attachment instead of the actual file.

Returns

A string containing the values of "Success" or "Error" depending on whether or not the operation succeeded.

Used With

COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server Script

GenerateProposal

GenerateProposal creates a new proposal record. The DocServer handles the work of generating the actual proposal.

Syntax

To specify a template:
BusComp.InvokeMethod("GenerateProposal", RecordExists, Replace, TemplateFile);

To use the default proposal template:
BusComp.InvokeMethod("GenerateProposal", RecordExists, Replace);

Argument
Description

RecordExists

If FALSE, then a new record is created and used to create a new proposal.

If TRUE, the current selected proposal is used.

Replace

If TRUE, the template file is copied from the template into the proposal (as a draft file). You should typically call this method with this argument set to FALSE.

TemplateFile

(Optional)
The default value of this argument is NULL.
A string that specifies the name of the template to use. When a string is passed into this argument, the proposal searches for the first template record whose name contains the string passed rather than using the default template.

Used With

Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server Script

GetFile

Obtains a file from the Siebel file system and places that file on the local file system of the Siebel Server or Mobile Client. Note that you must be properly positioned on the desired file attachment record to get the file and have it placed on the local file system's temporary directory.

Syntax

BusComp.InvokeMethod("GetFile", KeyField)

Argument
Description

KeyFieldName

The name of the field in the business component that contains the File Name. For example: AccntFileName field in the Account Attachment business component.

Returns

A string containing "Success, <outFilePath>" if the operation succeeded. OutFilePath is the fully qualified path of the file on the Client/Server machine in the user's temp directory. The return value is "Error" if the operation failed.

Used With

COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server Script

PutFile

Updates a file in the Siebel file system with a newer file. Note that you must be properly positioned on the desired file attachment record to update the file in the file system.

Syntax

BusComp.InvokeMethod("PutFile", SrcFilePath, KeyField)

Argument
Description

SrcFilePath

This is the fully qualified path of the file on the Siebel Server or Mobile Web Client.

KeyFieldName

This is the name of the field in the business component that contains the File Name. For example: AccntFileName field in the Account Attachment business component.

Returns

A string containing the values of "Success" or "Error" depending on whether or not the operation succeeded.

Usage

After using PutFile to save a file attachment the updated attachment is not visible in the user interface until you call the WriteRecord method. For more information about WriteRecord, read WriteRecord Method.

Used With

COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server Script

RefreshRecord

This method refreshes the business component, which triggers an update of the business component fields in the client display and positions the cursor on the context record.

Syntax

retVal = BusComp.InvokeMethod("RefreshRecord")

Argument
Description

none

 

Returns

Not Applicable

Used With

Browser Script, COM Data Control, Java Data Bean, Mobile Web Client Automation Server, Server Script

SetAdminMode

This method is particularly useful if you need to replicate the behavior enforced by the 'Admin' property of the View object by disabling all visibility rules for the business component.

Syntax

BusComp.InvokeMethod("SetAdminMode", flag)

Argument
Description

flag

"TRUE" or "FALSE". Flag to specify whether the business component should be executed in Admin mode.

Returns

Not Applicable

Used With

COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server Script

Siebel Object Interfaces Reference