errorm

Syntax

ERRORM text_expression, severity

Arguments

text_expression: text

severity: integer (0, 1 or 2)

Meaning

Displays the text_expression in Collections, optionally with a specified severity and in an associated colour. In Collections the message will disappear automatically after a few seconds or when you click it.

When used in an import adapl, the error message won't be displayed on screen, instead it'll be written to an import log (text) file in the folder containing your import job.

When the string contains backslashes, escape it first (using the ESCAPE function), otherwise the backslashes will be stripped from the string on display.

From Collections 1.19, ERRORM statements in adapls used in output formats are collected and displayed at the end of the output job. This applies to both adapl-only output formats (using WORDCREATEDOCUMENT or just PRINT and OUTPUT statements) and adapl+Word template output formats.

Examples  without severity code

errorm 'An automatic e-mail has been sent.'

errorm 'Record ' + %0 + ' is already locked by another user.'

errorm 'The COLLECT database could not be opened (error ' + &E + '): import fails.'

errorm escape('This is the images path: C:\axiell\images')

 

Errorm messages in different colours

The errorm statement in adapls may be used for different types of messages, just to inform the user, to warn the user or to alert the user about an error. From Axiell Designer version 7.7.1.170, command-line adapl compiler 7.6.20125.1 and Axiell Collections version 1.8.1.794, it is possible to show these messages in their own colour: blue for informative messages, orange for warnings and red for errors.

DifferentErrorColours

To this end the ADAPL errorm statement has been extended with an optional severity option. Depending on the severity level the message is shown in a different color:

errorm 'INFORMATION in blue', 0
errorm 'WARNING in orange', 1
errorm 'ERROR in red', 2

Note that there are no brackets around the arguments behind the errorm statement.

When the severity code is not set, it defaults to an (orange) warning, for backward compatibility.

When the error severity (value 2) is set, this has consequences for:

Before storage adapl procedures: the record can’t be saved if such an error occurs.
Before edit adapl procedures: the record doesn’t go into edit mode if such an error occurs.
Field adapl procedures: the code after the errorm is not executed any further.
Task adapl procedures will finish running the adapl for the currently processed record, but no further records will be processed.

The information and warning severities (values 0 and 1) have no such consequences.
Errorm's with severity codes can also be used in task adapls, screen adapls and field adapls.

Note that Collections also still generates green messages, to indicate that an action was successful, when a record has been saved correctly, for example.

Also note that an errorm in a task adapl doesn't generate a coloured pop-up message. Instead, all error messages will be listed in a window when the task has finished. And instead of colours, a fixed text will precede the error, indicating the severity: 0 will prefix the text Info:, 1 (or no severity) will prefix the text Warning:, 2 will prefix the text Error:. Errorm's generated by a storage adapl (which is executed after a FACS write action in a task adapl like for the Change locations task), will be displayed in the task window too.