Bookshelf Home | Contents | Index | PDF |
Siebel SmartScript Administration Guide > Extending Scripts with Siebel VB and Siebel eScript > Invoking a Business Service from a SmartScriptYou can invoke a business service from a SmartScript by using Siebel VB or Siebel eScript to make call statements for the required business service. This allows you to reuse code. The following example code retrieves information from a SmartScript and invokes the Universal Inbox business service to create a new item in the Inbox. For another example, see Invoking Siebel Assignment Manager. ssPage = GetPage("PAF Which Change"); ssQuestion = ssPage.GetQuestion("Display Employee Last Name"); EmployeeLastName = ssQuestion.GetCurrentValue(); ssQuestion = ssPage.GetQuestion("Display Employee First Name"); EmployeeFirstName = ssQuestion.GetCurrentValue(); ssQuestion = ssPage.GetQuestion("PAF Change Requested"); RequestedChange = ssQuestion.GetCurrentValue(); ssQuestion = ssPage.GetQuestion("PAF Comments"); PAFComments = ssQuestion.GetCurrentValue(); ssQuestion = ssPage.GetQuestion("PAF Priority"); PAFPriority = ssQuestion.GetCurrentValue(); // Cancel saving everything to the database indata =TheApplication ().NewPropertySet (); outdata = TheApplication ().NewPropertySet (); // Get the login name of the user szRequester = TheApplication ().LoginName (); // Get SmartScript Save Session table Id. szScriptSessionId = GetSessionId (); szSSLanguageCode = GetParameter("Language"); szSSCurrencyCode = GetParameter("Currency"); indata.SetProperty ("SmartScriptLanguageCode", szSSLanguageCode); // ItemObjectId, ItemType, ItemSubmittedBy, and ItemDescription are the // required input arguments for the "Universal Inbox.Initialize" indata.SetProperty ("ItemObjectId", szScriptSessionId); // Item Type is the Approvals Inbox type defined in the // Approvals Inbox Administration screen indata.SetProperty ("ItemType", "Personnel Action Form"); // Short Description of the inbox item indata.SetProperty ("ItemDescription", RequestedChange + " PAF" + " for " + EmployeeFirstName + " " + EmployeeLastName); indata.SetProperty ("ItemSubmittedBy", szRequester); // ItemQueueDuration, ItemPriority, and ItemComments are the // optional input arguments for the "Universal Inbox.Initialize" indata.SetProperty ("ItemQueueDuration", "129600"); indata.SetProperty ("ItemPriority", PAFPriority); indata.SetProperty ("ItemComments", PAFComments); svc = TheApplication ().GetService ("Universal Inbox"); svc.InvokeMethod("Initialize", indata, outdata); var bo = TheApplication().GetBusObject("Smart Scripts"); var bc = bo.GetBusComp("Call Script Runs"); bc.ActivateField("Status Code"); |
Siebel SmartScript Administration Guide | Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices. | |