Skip to main content

Posts

Showing posts with the label Business Service

How to get Siebel attachment as file in Workflow

You might need to extract a specific file from Siebel Attachments or want to attach that file in Email as attachment. To achieve that Siebel provide a vanilla business service which will get file and return its path. Prepare the workflow and drag drop the Business Service step on workflow canvas. Open properties and set the as below: Business Service Name: FINS Industry BC Facility Service Business Service Method: GetFile Now go to " Multi Value Property Window " and add the below Input Arguments : AttachmentId > Row Id of specific attachment which you want to get as file. BusObjName > Business Object name in which Attachment Business Component is present. FileBusCompName > Attachment Business Component Name. FileNameField > Attachment Name Field. If you are not sure which field is in your case, query " FILE_NAME " in Business Component Column and use that Field Name which query will return. RootBusCompName > If Attachment Business Component is...

How to remove Line Breaks from a string using Siebel eScript

In Siebel if you copy the value from field (which have line break character) and paste in notepad it will look fine, but when you use query step in workflow or script and check the logs, the search spec will have a large white space due the line break character stored in data base of that specific column and query will not work. For removing line breaks in a field you can use below eSciprt. Line breaks in strings Windows: \r\n carriage return followed by newline character. Linux: \n just a newline character. Regular Expression: if(MethodName == "Remove LB CR")     {         var vTemp = Inputs.GetProperty("vIn");         vTemp = vTemp.replace( /[\r\n]+/gm, "");         Outputs.SetProperty("vOut",vTemp);         return (CancelOperation);     }   See Also: How to remove Line Break when selecting data from SQL Server

Find record query loop in Siebel eScript

  var EngBO, EngBC, EngId, RecordCount, withRecord, UserName, UserId; EngBO = TheApplication().GetBusObject("My Business Object"); EngBC = EngBO.GetBusComp("My Business Component");          with (EngBC)     {         ActivateField("Parent Id");         SetViewMode(AllView);         ClearToQuery();         SetSearchSpec ("Parent Id", ServiceId);         ExecuteQuery(ForwardOnly);         RecordCount = CountRecords();         withRecord = FirstRecord();                  while(withRecord)         {             EngId = GetFieldValue("Id");             UserNa...

Insert record through Siebel eScript

Insert Record through Siebel eScript var TBO, TBC; TBO = TheApplication().GetBusObject("My Business Object"); TBC = TBO.GetBusComp("My Business Componenet");     with(TBC)     {         NewRecord(NewAfter);         SetFieldValue("End Time",TE);         SetFieldValue("Start Time",TS);         SetFieldValue("Status","Active");         SetFieldValue("User Id",UserId);         SetFieldValue("Parent Id",EngId);         SetFieldValue("Date","08/10/2021");                     WriteRecord();     }

How to get desired characters from a String in Siebel eScirpt

substring() Method Extract desired characters from a String (Length Fixed) var SHRs, SMins, TimeStart = "10:30"; SHRs = TimeStart.substring(0,2); //0: Start, 2: End not included SMins = TimeStart.substring(3,5); Results: SHRs: 10 SMins: 30 -- -- -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- -- -- -- Syntax stringVar.substring(start[, end]) start: An integer specifying the location of the beginning of the substring to be returned end: An integer one greater than the location of the last character of the substring to be returned Returns A new string, of length end - start, containing the characters that appeared in the positions from start to end - 1 of stringVar. Usage This method returns a portion of stringVar, comprising the characters in stringVar at the positions start through end - 1. The character at the end position is not included in the returned string. If the end parameter is not used, stringVar.substring() returns the characters fr...

How to get Day name from date in Siebel eScript

Below function in Siebel eScipt will return the Day from the date. Input: CurrentDate: 08/10/2021 (MM/DD/YYYY) Result: Tuesday var dayName, CurrentDate; dayName = GetWeekDay(CurrentDate);  -- -- GetWeekDay -- -- function GetWeekDay(currentDate) {     var weekDay, sDate, theYear, sDay = "", i = 0;     weekDay = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");     sDate = new Date(currentDate);     theYear = sDate.getFullYear()          while (i < sDate.getDay())     {         i++;         sDay = weekDay[i];     }     return(sDay); }

How to get today date in MM DD YYYY format in Siebel eScript

Below is eScript which will get the today's date: var CurrentDate, DateStart, MM, DD, YYYY; if (DateStart == "")         {             CurrentDate = new Date;             //above line will get the date in "Tue Aug 10 2021 13:30:45" format.             DD = CurrentDate.getDate();             MM = (CurrentDate.getMonth() + 1);             YYYY = CurrentDate.getFullYear();             DateStart = ToNumber(MM) + "/" + ToNumber(DD) + "/" + ToNumber(YYYY);         }

How to get today date for next year in MM DD YYYY format in Siebel eScript

Below sScript will help to get today's date with next year. Today: 08/10/2021 Result: 08/10/2022 var  CurrentDate, DateEnd, DD, MM, YYYY;  if (DateEnd == "")         {             //Next Year Date                CurrentDate = new Date;                //Tue Aug 10 2021 13:30:45             DD  = CurrentDate.getDate();             MM = (CurrentDate.getMonth() + 1);             YYYY = (CurrentDate.getFullYear() + 1);             DateEnd = ToNumber(MM) + "/" + ToNumber(DD) + "/" + ToNumber(YYYY);             //Outputs.SetProperty("OutTest",DateEnd);         }...

How to get Date difference in Days Siebel eScript

  Date input: MM/DD/YYYY format. Function will return date difference in Days. Inputs: DateStart: 08/10/2021 DateEnd: 08/11/2021 Result: DaysCount : 2   var DaysCount, DateStart, DateEnd; DaysCount = getDateDiff(DateStart, DateEnd);  -- -- -- getDateDiff -- -- -- function getDateDiff(DateStart, DateEnd) {     DateEnd  = new Date(DateEnd);     DateStart  = new Date(DateStart);     var diffDays = (DateEnd - DateStart)/(1000*60*60*24);     diffDays = ToNumber(diffDays)+1;     return(diffDays) }

The method %1 is not supported on Business Service %2. SBL-DAT-00323

Error: The method 'My BS Method' is not supported on Business Service 'My Custom Business Service'. (SBL-DAT-00323)    Possible reason and solution: Check your method which is causing the error, at the end of method add cancel operation as return. if (MethodName == "My BS Method" ) {     //code code code     return ( CancelOperation ) }  

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 to convert date DDMMYYYY to MMDDYYYY through Siebel eScript

Below code will convert DD/MM/YYYY to MM/DD/YYYY date format. if(MethodName == "SETDATE")                 {                                 var LICENSEDATE = Inputs.GetProperty("DATEin");                                 var length = LICENSEDATE.length;  // Length Count                                                          ...

How to Split String through Siebel eScript

I have created a Business Service, which takes single input and split the name based on space return the final values in output arguments. Below is the script: var FullName = Inputs.GetProperty("Full Name"); var NameArray = FullName.split(" "); var FirstName = NameArray[0]; var SecondName = NameArray[1]; var ThirdName = NameArray[2]; Outputs.SetProperty("First Name", FirstName); Outputs.SetProperty("Second Name", SecondName); Outputs.SetProperty("Third Name", ThirdName); How to create Business Service in Siebel

How to create Business Service in Siebel

Create new record in Business Service, provide appropriate name and project. Create new record in Business Service Method, provide appropriate method name. Expand Business Service Method and create new records in Business Service Method Arguments and select Type as Input and Output. Right Click on Business Service name and click on Edit Server Scripts. In Service_PreInvokeMethod write your script. function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { if(MethodName == "SET") { var IP = Inputs.GetProperty("in"); //Input Property name defined in Business Service Method Arguments var rep = /(-)/g; IP = IP.replace(rep , ""); Outputs.SetProperty("out", IP); //Output Property name defined in Business Service Method Arguments return (CancelOperation); } return (ContinueOperation); } Save, Compile and Test.

How to remove special character from a string through Siebel eScript

I have created a simple Business Service, which takes single input and check if that string contain "-" and it will remove and return the final value in output argument. Below is the script: var IP = Inputs.GetProperty("in"); var rep = /(-)/g; IP = IP.replace(rep , ""); Outputs.SetProperty("out", IP); How to create Business Service in Siebel

How to invoke workflow through BC eScript, BC User Property and Runtime Events

Through eScript  BC InvokeMethod if (MethodName == "MyMethod") { var oBS=TheApplication().GetService("Workflow Process Manager"); var Inp=TheApplication().NewPropertySet(); var Out=TheApplication().NewPropertySet(); Inp.SetProperty("Object Id",TheApplication().ActiveBusObject().GetBusComp("My BC Name").GetFieldValue("My BC Field")); Inp.SetProperty("ProcessName","My Workflow"); oBS.InvokeMethod("RunProcess",Inp,Out); return (CancelOperation);   } On BC PreSetField if(FieldName == "My Field Name")    {     if(FieldValue == "My Field Value") { var Inp=TheApplication().NewPropertySet(); var Out=TheApplication().NewPropertySet(); Inp.SetProperty("Object Id",TheApplication().ActiveBusObject().GetBusComp("My BC Name").GetFieldValue("My BC Field")); Inp.SetProperty("ProcessName","My Workflow...

Siebel eScript for sending information to http site using EAI HTTP Transport Business Service

Below is the eScript for sending information to http site. Business Service: EAI HTTP Transport Method: SendReceive eScript: var sUrl = "http URL on which you want to send/ receive information"; var sRequest =""; var oService = TheApplication().GetService("EAI HTTP Transport"); var oInputs = TheApplication().NewPropertySet(); var oOutputs = TheApplication().NewPropertySet(); oInputs.SetProperty("HTTPRequestBodyTemplate", sRequest); oInputs.SetProperty("HTTPRequestMethod", "POST"); oInputs.SetProperty("HTTPRequestURLTemplate", sUrl); oService.InvokeMethod("SendReceive", oInputs, oOutputs); var Prop1 = oOutputs.urlProp1

Operation 'Method Name' is expecting a response but no response was received.(SBL-EAI-04311) in Siebel

Siebel is returning below error, when invoking Outbound Web Service through Workflow. Error Code (SBL-BPR-00162)--IDS_EAI_WS_OD_RESPONSE_EXPECTED Error Message Error invoking service 'Business Service', method 'Method Name' at step 'Workflow Step Name'.(SBL-BPR-00162)--Operation 'Method Name' is expecting a response but no response was received.(SBL-EAI-04311) You should be getting above error while invoking Outbound Web Service through Workflow. Reason: Web Service might be unavailable at the host location. The machine on which Siebel Web Server is installed is not able to access the end point URL. Solution: Check with Vendor. Add entry of End Point URL in Windows Host file or exclude from Firewall and Antivirus.