All About Siebel

Thursday, April 17, 2008

How to invoke a vanilla method in e script which is defined under the object "Command"?

In a recent discussion with my colleagues, I got stuck on this question. How can we invoke a command? With a little research and experiments I found out the way. Here it is ….
Vanilla methods defined under command objects can be invoked with the help of Business component instances.

Let's take an example with one command 

Clear LOV Cache (SWE), hope every one is familiar about this command.
The underlying method for this method is ClearLOVCache. This method can be used with button controls on any applet based on BC "List Of Values", since this method is available under the business component "List Of Values". Not only on the same BC methods, but also you can invoke methods of a different BC methods through Applet, BC, and BS scripts. Have a look at the sample code below

var bo = TheApplication().GetBusObject("List Of Values");
var bc = bo.GetBusComp("List Of Values");
bc.InvokeMethod("ClearLOVCache");

Bottom line for this approach is that the method you are invoking should be available in the active instance of the Business component

Please let me know ur view on this . You can write me at siebelbee at gmail dot com.

2 comments:

vishnu Sharma said...

hai
can we sum two field values how

Siddhesh said...

I am trying to invoke method "SaveTemplate". This method is defined on a button "Save Template" on applet "Email Offer Template HTM Detail Form Applet"

I have written this line in BC "Email Offer Template" this.InvokeMethod("Save Template"); I am getting error at this line. It says method not recognized.

Any suggestions