Skip to main content

Posts

Showing posts with the label PreSetField

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 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...