CONTAINSERRORS

The CONTAINSERRORS function tests a valid object to see whether it contains any objects in error.

Syntax:
CONTAINSERRORS (single-object-expression)
Meaning:
CONTAINSERRORS (object_to_test)
Returns:
True or false

The CONTAINSERRORS function returns "true" if any object contained in object_to_test is in error; it returns "false" if the object_to_test is completely valid.

The input object, itself, is a valid input object. This function does not evaluate for invalid objects. Therefore, if you have map rule:

CONTAINSERRORS ( Invoice:InputFile )

and Invoice[1] is valid, Invoice[2] is invalid, and Invoice[3] is valid, then CONTAINSERRORS evaluates only twice-once for each valid instance of Invoice.

Examples

  • Msg (s) = IF ( CONTAINSERRORS ( Msg:MailBag ) & Type:Msg:MailBag = "PRIORITY" , Msg:MailBag , "none" )

    In this example, if Msg:MailBag contains any object in error and Type:Msg:MailBag has a value of "PRIORITY", Msg:MailBag is mapped; otherwise, "none" is returned for this occurrence of Msg. This map rule returns all valid messages (Msg) that contain errors with a Type of "PRIORITY".

Related functions

  • ISERROR
  • REFORMAT