Siebel Object Interfaces Reference > Interfaces Reference > Application Methods >

RaiseErrorText Method


The RaiseErrorText method raises a scripting error message to the browser. The error text is the specified literal string. The optional arguments are used to format the string if it contains any substitution arguments (%1, %2).

Syntax

Application.RaiseErrorText(value, [arg1], [arg2],...., [argN])

Argument
Description

value

The error text message.

arg1, arg2, ..., argN

Optional arguments used to format the error message if it contains any substitution arguments (%1, %2).

Returns

Not applicable

Usage

When invoked, the RaiseErrorText method stops execution of the script. Therefore, CancelOperation is not required after RaiseErrorText.

Internally, the RaiseError and RaiseErrorText methods raise a Server Script exception. Therefore, if you have implemented error handling in your scripts, the error handling can suppress RaiseError and RaiseErrorText functionality.

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

NOTE:  Do not use the %s and %n formatting literals with the RaiseErrorText method. This causes unpredictable results.

CAUTION:  Be careful when using RaiseErrorText, because it cancels operations. For example, if it is used in BusComp_PreWriteRecord, the user or code will not be able to step off the current record until the condition causing the RaiseErrorText method to be invoked is addressed.

Used With

Server Script

Example

In the following eScript example, the RaiseErrorText results in a scripting exception being raised, transferring control to the catch statement. For the error message to be displayed, the error must be thrown, using the throw statement.

function BusComp_PreDeleteRecord ()
{
   try {
      var status = this.GetFieldValue("Account Status");
   
      if (status == "Gold") {
         TheApplication().RaiseErrorText("Unable to delete Gold Account");
      }
      else {
         return (ContinueOperation);
      }
   }
   catch (e) {
      throw e;
   }

}

The following eScript example raises an error when deleting an opportunity with the "Pipeline" revenue class.

function BusComp_PreDeleteRecord ()
{
   try
   {
      var revClass = this.GetFieldValue("Primary Revenue Class");
      if (revClass == "1-Pipeline")
      {
         TheApplication().RaiseErrorText("Exception occurred in %1. Unable to
         delete Opportunity with %2 revenue class.", "PreDeleteRecord", revClass);
      }
      else
      {
         return (ContinueOperation);
      }

   }
   catch (e)
   {
      throw e;
   }
}

Siebel Object Interfaces Reference Copyright © 2008, Oracle. All rights reserved.