Skip to main content

Posts

Showing posts with the label Service_PreInvokeMethod

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