Skip to main content

Posts

Showing posts with the label TheApplication

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

Siebel Go to View eScript

function GotoView() { var BO : BusObject = TheApplication().GetBusObject("Contact"); var BC : BusComp = BO.GetBusComp("Contact"); this.BusComp().ActivateField("Contact Id"); var sConId = this.BusComp().GetFieldValue("Contact Id"); with(BC) { SetViewMode(AllView); ClearToQuery(); ActivateField("Id"); SetSearchSpec("Id", sConId); ExecuteQuery(ForwardOnly); if (FirstRecord()) { TheApplication().GotoView("Contact Details View", BO); } } }