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 for the Business Component Object.

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

A string containing the result of the method

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. Oracle does not support calling specialized methods with InvokeMethod, unless they are listed in this book.

Used With

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

Example

For examples of the usage of InvokeMethod, see ClearLOVCache Method, CreateFile Method, GetFile Method, and PutFile Method.

InvokeMethod Methods for the Business Component Object

Siebel applications provide multiple methods for performing useful operations, such as manipulating files stored in the Siebel File System and refreshing records and business components. These methods can be invoked using server script (Siebel VB, eScript) or using one of the programmatic interfaces (Mobile Web Client Automation Server - connected mode only, COM Data Control, Java Data Bean).

The following methods are available for use with InvokeMethod:

The methods available for manipulating the file system (CreateFile, GetFile, and PutFile) always store the file to or retrieve the file from the file system local to the server on which the script is being executed. 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.

ClearLOVCache Method

This method clears the object manager list of values (LOV) cache, functioning similarly to the Clear Cache button in the Administration - Data > List of Values view.

NOTE:  ClearLOVCache clears only the object manager cache, not the session cache in the High Interactivity client.

Syntax

BusComp.InvokeMethod("ClearLOVCache")

Argument
Description

none

 

Returns

Not Applicable

Used With

This method is supported by BusComp.InvokeMethod() calls in Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, and Server Script.

Example

The following Siebel eScript example is for Server Script:

function WebApplet_PreInvokeMethod (MethodName)

{

if (MethodName == "TestMethod") {

var lov_bo = TheApplication().GetBusObject("List Of Values");

var lov_bc = lov_bo.GetBusComp("List Of Values");

lov_bc.NewRecord(NewAfter);

lov_bc.SetFieldValue("Type", "ACCOUNT_STATUS");

lov_bc.SetFieldValue("Name", "Hello");

lov_bc.SetFieldValue("Value", "Hello");

lov_bc.SetFieldValue("Order By", "12");

lov_bc.SetFieldValue("Translate", "Y");

lov_bc.WriteRecord();

lov_bc.InvokeMethod("ClearLOVCache");

lov_bc = null;

lov_bo = null;

return (CancelOperation);

}

return(ContinueOperation);

}

CreateFile Method

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, KeyFieldName, 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 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 value "Success" or "Error" depending on whether or not the operation succeeded.

Used With

This method is supported by BusComp.InvokeMethod() calls in COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, and Server Script.

Example

The following example is in Siebel VB:

Dim RetValue as String
Dim fileBC as BusComp

'Instantiate fileBC as the appropriate attachment business component

fileBC.NewRecord NewAfter
RetValue = fileBC.InvokeMethod ("CreateFile", "c:\Demo\Image.bmp", "AccntFileName", "Y")
fileBC.WriteRecord

The following example is in Siebel eScript:

var fileBC;

// Instantiate fileBC as the appropriate attachment business component

fileBC.NewRecord(NewAfter);
RetValue = fileBC.InvokeMethod ("CreateFile", "C:\\Demo\\Image.bmp", "AccntFileName", "Y");
fileBC.WriteRecord();

The following example is in COM Data Control:

Dim errCode as Integer
Dim Args(2) as String
Dim RetValue as String
Dim fileBC as BusComp

'Instantiate fileBC as the appropriate attachment business component

Args(0) = "C:\Demo\Image.bmp"
Args(1) = "AccntFileName"
Args(2) = "Y"

fileBC.NewRecord NewAfter, errCode
RetValue = fileBC.InvokeMethod ("CreateFile", Args, errCode)
fileBC.WriteRecord

GenerateProposal Method

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

This method is supported by BusComp.InvokeMethod() calls in Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, and Server Script.

GetFile Method

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", KeyFieldName)

Argument
Description

KeyFieldName

The name of the field in the business component that contains the File Name, for example, AccntFileName 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

This method is supported by BusComp.InvokeMethod() calls in COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, and Server Script.

Example

The following example uses Siebel VB:

Dim RetValue as String
Dim fileBC as BusComp

'Instantiate fileBC as the appropriate attachment business component

'Query for the desired attachment record

RetValue = fileBC.InvokeMethod ("GetFile", "AccntFileName")

The following example uses Siebel eScript:

var RetValue;
var fileBC;

// Instantiate fileBC as the appropriate attachment business component

// Query for the desired attachment record

var RetValue = fileBC.InvokeMethod("GetFile", "AccntFileName");

The following example uses COM Data Control:

Dim errCode as Integer
Dim Args as String
Dim RetValue as String
Dim fileBC as BusComp

'Instantiate fileBC as the appropriate attachment business component

'Query for the desired attachment record

Args = "AccntFileName"
RetValue = fileBC.InvokeMethod ("GetFile", Args, errCode)

PutFile Method

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, KeyFieldName)

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

This method is supported by BusComp.InvokeMethod() calls in COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, and Server Script.

Example

The following example uses Siebel VB:

Dim RetValue as String
Dim fileBC as BusComp

'Instantiate fileBC to the appropriate attachment business component

'Query for the attachment record to be updated

RetValue = fileBC.InvokeMethod ("PutFile", "c:\Demo\Image.bmp", "AccntFileName")
fileBC.WriteRecord

The following example uses Siebel eScript:

var RetValue;
var fileBC;

// Instantiate fileBC to the appropriate attachment business component

// Query for the attachment record to be updated

RetValue = fileBC.InvokeMethod("PutFile", "c:\\Demo\\Image.bmp", "AccntFileName");
fileBC.WriteRecord();

The following example uses COM Data Control:

Dim errCode as Integer
Dim Args(1) as String
Dim RetValue as String
Dim fileBC as BusComp

'Instantiate fileBC to the appropriate attachment business component

'Query for the attachment record to be updated

Args(0) = "C:\Demo\Image.bmp"
Args(1) = "AccntFileName"
RetValue = fileBC.InvokeMethod ("PutFile", Args, errCode)
fileBC.WriteRecord

RefreshBusComp Method

This method re-executes the current query for the business component and places the focus back onto the record that was previously highlighted. The user sees that the data is refreshed but the same record is still highlighted in the same position in the list applet as before the RefreshBusComp method was invoked.

Syntax

BusComp.InvokeMethod("RefreshBusComp")

Argument
Description

none

 

Returns

Not Applicable

Used With

This method is supported by BusComp.InvokeMethod() calls in Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, and Server Script.

NOTE:  This method only works with business components that are derived from CSSBCBase.

RefreshRecord Method

This method refreshes the currently highlighted record, which triggers an update of the business component fields in the client display and positions the cursor on the context record. Other records currently exposed in the user interface are not refreshed.

Syntax

retVal = BusComp.InvokeMethod("RefreshRecord")

Argument
Description

none

 

Returns

Not Applicable

Used With

This method is supported by BusComp.InvokeMethod() calls in Browser Script, COM Data Control, Java Data Bean, Mobile Web Client Automation Server, and Server Script.

NOTE:  This method only works with business components that are derived from CSSBCBase.

SetAdminMode Method

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

This method is supported by BusComp.InvokeMethod() calls in COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, and Server Script.

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