Bookshelf Home | Contents | Index | PDF |
Siebel Object Interfaces Reference > Interfaces Reference > Application Methods > RaiseError MethodThe 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 arguments are used to format the string if it contains any substitution arguments (%1, %2). SyntaxApplication.RaiseError(key, [arg1], [arg2],...., [argN]) ReturnsUsageWhen invoked, the RaiseError method causes execution of the script to terminate, and sends a notification to the browser. Therefore, CancelOperation is not required after RaiseError. Internally, the RaiseError/RaiseErrorText methods raise a Server Script exception. 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, when 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. CAUTION: Be careful when using RaiseError, 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 RaiseError method to be invoked is addressed. Used WithExampleIn the following eScript example, the RaiseError results in a scripting exception 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 () The following eScript example raises the error message "This user-defined test error is used in PreDelete, as an example for RaiseError Method" when deleting an opportunity with the "Pipeline" revenue class. Note that the key "user-defined test error1" is predefined as "This user-defined test error is used in %1, as an example for %2". When the script runs, 'PreDelete' is substituted for %1 and 'Raise Error Method' is substituted for %2. function BusComp_PreDeleteRecord () |
Siebel Object Interfaces Reference | Copyright © 2008, Oracle. All rights reserved. | |