RaiseErrorText Method for an Application
The RaiseErrorText method sends a scripting error message to the browser. This method does not return any information.
Format
Application.RaiseErrorText(value, [arg1], [arg2],...., [argN])
The following table describes the arguments for the RaiseErrorText method.
Argument | Description |
---|---|
value |
The error text message. |
Other arguments:
|
If the error message contains a substitution argument, such as
|
Usage
Usage for the RaiseErrorText method is very similar to usage for the RaiseError method. For more information, see Usage for the RaiseError Method in RaiseError Method for an Application.
Used With
Server Script
Examples
In the following Siebel eScript example, the RaiseErrorText method causes Siebel CRM to raise a scripting exception and then transfer control to the Catch statement.
function BusComp_PreDeleteRecord ()
{
try {
var status = this.GetFieldValue("Account Status");
if (status == "Gold") {
TheApplication().RaiseErrorText("Unable to delete Gold Account");
} // end if (status == "Gold")
else {
return (ContinueOperation);
} // end else
} // end try
} // end function
In the following Siebel eScript example, if the user deletes an opportunity that includes Pipeline as the revenue class, then Siebel CRM sends an error:
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);
} // end if (revClass == "1-Pipeline")
else {
return (ContinueOperation);
} //end else
} // end try
catch (e)
{
// Put here any logic that must be executed before displaying an error to user
throw e;
} //end catch
} // end function