Skip to main content

Posts

Showing posts with the label Server Script

How to sort and add search specification in Siebel Applet Load script

Normally we use Search specification filed in Applet List, but sometime we have to add long search expression which Search specification field can not contain (max length is 255 characters). For that we can add search specification in applet load server scripts. Right click on applet and from menu click on "Edit Server Scripts". From functions list click on "WebApplet_Load". First get the bussiness component by follow below script var oBusComp = this .BusComp () ; Now add with (The ' with ' statement adds the given object to the head of this scope chain during the evaluation of its statement body.) and statement Add Sort specification as below SetSortSpec( "Created(DESCENDING)" ); Now write search specification on the desired fields for mvl field you need to use "EXISTS". var Search1 = "EXISTS ([Case Contacts] = '" + case_id + "')" Using AND/OR you can extend the search specification. var Search1 = "...

How to query or find record in Siebel Business Component

You can perform query operation on Business Component through Workflow, eScript with the help of Siebel Operation, Inbound E-mail Database Operations (method: FindRecord) or EAI Siebel Adapter (method: Query but you need to create Integration Objects). This Business Component can be Virtual Business Component (VBC), External Business Component (EBC) or generic Business Component (BC).  See also: Difference Between Business Components and How to Create BC in Siebel through Object Wizard through Workflow with the help of Siebel Operation Create a workflow and provide the Business Object, business component should be in this BO for which you want to perform the query operation. From the Palettes window drag drop the Siebel Operation into workflow designer plane. Select the Siebel Operation box and open the properties window, provide the Business Component name from the drop down list and set Query in Operation field. You can set the search specification by two means either provide the...

How add restriction of length and if field value if not a number in Siebel

You can use below eScript on Pre Set Field Value (recommended) or Set Field Value on Business Component Server Script. if (FieldName = "SSN")  { var SSNNum = this.GetFieldValue("SSN"); var sErrTxt = TheApplication().LookupMessage("User Defined Errors","Wrong SSN"); var result = isNaN(SSNNum);  // is not a number var length = SSNNum.length;  // Length Count if (result) { TheApplication().RaiseErrorText(sErrTxt); } else if (length < "15" || length > "15")  { TheApplication().RaiseErrorText(sErrTxt); } }

How to get Parent BC Field Values from Child BC through BC Server Script in Siebel

By using ParentBusComp Method you can get Parent BC field value from Child BC server script, given that in BO there must be link between Parent and Child BC. (ParentBusComp returns the parent (master) business component when given the child (detail) business component of a Link.) I have written below eScript on Child BC for getting Parent BC field value, Parent BC fields should be forced active or you have to active them in eScript using ActivateField(). var ParBC = TheApplication().ActiveBusObject().GetBusComp("ChildBC Name").ParentBusComp(); var FCASE_ID = ParBC.GetFieldValue("Id"); Source: https://docs.oracle.com/cd/B40099_02/books/OIRef/OIRefInterfaceRef117.html

How to invoke Workflow through eScript in Siebel

Below is the Script for Calling Workflow: if (MethodName == "Method Name") { var oBS=TheApplication().GetService("Workflow Process Manager"); var Inp=TheApplication().NewPropertySet(); var Out=TheApplication().NewPropertySet(); Inp.SetProperty("Object Id",TheApplication().ActiveBusObject().GetBusComp("Business Component Name").GetFieldValue("Id")); Inp.SetProperty("ProcessName","Workflow Name"); oBS.InvokeMethod("RunProcess",Inp,Out); return (CancelOperation);   }