Data Transformation Engine Functions and Expressions Reference Guide

Chapter 3 - Function Reference ONERROR
Functions and Expressions Reference Guide
158
ONERROR
The ONERROR function adds a user-defined error message to the data section of
the audit log. This function is relevant only in Type Designer Component rules.
Syntax
ONERROR (single-condition-expression , single-text-
expression)
Meaning
ONERROR (condition_to_evaluate , message_to_display)
Returns
This function returns TRUE or FALSE.
If condition_to_evaluate evaluates to TRUE, the function returns TRUE.
If condition_to_evaluate evaluates to FALSE, the function returns FALSE. If
data audit is enabled and the object to which the component rule applies will
result in a failed component rule message (status E09), message_to_display is
written to the data audit section of the audit log with an entry type of U,
representing user-defined.
If the failed component rule message (E09) appears in the data section of the
audit log, one or more user-defined error messages can also be included in the
data section of the audit log. If a component rule has one
ONERROR function,
one user-defined error message or none is included in the audit log. If a
component rule has two
ONERROR functions, two user-defined error messages
at most are included in the audit log, and so on.
Example
Here is a component rule without
ONERROR:
Claim Date Field > Accident Date Field &
Claim Date Field < ADDDAYS (Accident Date Field, 365)