Skip to main content

Posts

Showing posts with the label RaiseErrorText

How to popup a message in Siebel

You can use COMCreateObject("WScript.Shell") for displaying the custom message or for debugging the issues in eScript. This can be used in server script and in older versions of Siebel (which supports vb script). Below is the example: //Instantiate var msg = COMCreateObject( "WScript.Shell" ); //Display message msg.popup( "Custom text" + variable ,0, "Message title" ); //Example: of text and variable concatenation msg.popup( "Doc Num:" +docNum + " Owner Id:" +OwnerId+ " P Id:" +POAsrId,0, "Debus Script" ); You can use TheApplication() .RaiseErrorText( "Text" + variable); but Siebel will consider this as error and will not execute any code after this.

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); } }