Saturday, November 29, 2008

Call Business Service from Browser : A Trick

Siebel is really a miser if talk of browser script.... but, here is the way that can be used to take full advantage out of it :)

At times we have the requirement to call a Business Service from “Browser Script” then it is necessary to make the entry of that “Business Service” everytime in .CFG file with the following syntax under [SWE] section of the CFG file:

ClientBusinessService X = “”Where X = 1,2,3,4……

So, to get rid of this here is a trick. You can implement a new "Generic Business Service" which will internally call the Business Service that we want to call from Browser Script.

Name of Business Service = CallBusSerFromBrowScript
Method Name = Service_PreInvokeMethod

Generic business Service Code :
function Service_PreInvokeMethod (MethodName, Inputs, Outputs)
if(MethodName == “GenericCall”)
var svc = TheApplication().GetService(Inputs.GetProperty(”BSName”));
svc.InvokeMethod(Inputs.GetProperty(”MethodName”), Inputs, Outputs);
svc = null;
return (ContinueOperation);

Procedure for Calling :
Please follow the below code for calling your Business Service from browser script. Lets say you want to call “MyBusinessService” with Method Name = “MyMethod”, then use the following code :
var input = theApplication().NewPropertySet();
var output = theApplication().NewPropertySet();
input.SetProperty(”MethodName”,”MyMethodsvc = theApplication().GetService(”CallBusSerFromBrowScript”);
svc.InvokeMethod(”GenericCall”, input, output);
svc = null;output = null;input = null;
ToDo List ( Admin Team + Development Team + QA Team)
1. Please update the following code in .CFG file of your web client under [SWE] section with the name of Generic Business Service. This is to be done one time only.

ClientBusinessServiceX = “CallBusSerFromBrowScript”where X = 1,2,3………..
TA DA…… once you are done with this, life become easy. Try it out !!!!!!!!!
This way you make the life of your Siebel-Admin people easier as they don’t require making changes in CFG file in every release. :)

No comments:

Post a Comment