Siebel Object Interfaces Reference > Interfaces Reference > Application Methods >

RaiseError


The RaiseError method raises a scripting error message to the browser. The error code is a canonical number. The error text is based on the specified key, looked up for the current language from the User-Defined Errors category. You can define these errors in Tools using the Message Category object. The optional parameters are used to format the string if it contains any substitution parameters (%1, %2).

Syntax

Application.RaiseError(("<key>", [param1], [param2],...., [paramN]))

Parameter
Description
Key
 
param1, param2, ..., paramN
Optional parameters used to format the error message if it contains any substitution parameters (%1, %2).

Returns

Not applicable

Usage

When invoked, the RaiseError method causes execution of the script to terminate, and sends a notification to the browser.

Internally, the RaiseError/RaiseErrorText methods raise a Server Script exception. Therefore, if you have implemented error handling in your scripts, please note that the error handling can suppress RaiseError/RaiseErrorText functionality. In the following eScript example, the RaiseErrorText results in a scripting execution being raised, transferring control to the catch statement. To display the error message, the error must be thrown using the throw statement.

function BusComp_PreDeleteRecord ()
{
   try {
      var status = this.GetFieldValue("Account Status");
   
      if (status == "Gold") {
         TheApplication().RaiseError (<user defined error name>);
         return (CancelOperation);

      }
      else {
         return (ContinueOperation);
      }
   }
   catch (e) {
      throw e;
   }

}

If you have implemented error handling in Siebel VB, remember that if you are using "On Error Goto ...", the RaiseError and RaiseErrorText methods results in the script transferring execution to the error handler. "On Error Resume Next" suppresses the RaiseError and RaiseErrorText methods.

Used With

Server Script


 Siebel Object Interfaces Reference 
 Published: 18 June 2003