Skip to main content

Posts

Showing posts with the label 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 add confirm message dialog on button click in Siebel Applet Browser Scripts

Background: On some action like button click it is recommended to add confirmation message as user might accidentally click the button and operations starts or change the value of field based on which some action happen like a trigger. Process: Add below script Applet Browser Script, compile and generate browser scripts and test. function Applet_PreInvokeMethod (name, inputPropSet) {    if(name == 'NewRecord')    {       if(confirm("Are you sure you want to create a new record??"))          return ("ContinueOperation");       else          return ("CancelOperation");     } return ("ContinueOperation"); }   Change the method name and message as per your need. Note: On every compilation you will need to regenerate the browsers scripts and place on web server path.