Calling Methods for Business Services
The example in this topic describes how to call a method for a business service when the user clicks a button.
To call methods for buttons
Use a JavaScript editor to open the plug-in wrapper for the button.
Locate the click handler for the button.
Add the following code to the code that you located in Step 2:
var service = SiebelApp.S_App.GetService("business_service_name"); if (service) { var inPropSet = CCFMiscUtil_CreatePropSet(); //Code occurs here that sets the inPropSet property set with all information that Siebel Open UI must send as input to the method that it calls. var ai = {}; ai.async = true; ai.selfbusy = true; ai.scope = this; ai.mask = true; ai.opdecode = true; ai.errcb = function(){ //Code occurs here for the method that Siebel Open UI runs if the AJAX call fails }; ai.cb = function(){ //Code occurs here for the method that Siebel Open UI runs if the AJAX call is successful }; service.InvokeMethod("method_name", "input_arguments", ai); }
For more information, see InvokeMethod Method for Presentation Models.