Displays an error message and ends the execution of C/AL code.

ERROR(String [, Value1, …])

Parameters

String

Type: Text constant or code

This string contains the text of the error message you want to display to the user. Use percent signs (%) or number signs (#) to insert variable values into the string. Place the percent or number signs where you want to substitute the variable value. The string can be a text constant that is enabled for multilanguage functionality. For more information, see Working with Multilanguage Functionality.

Value1,…

Type: Any

Any variable or expression to be inserted in String. You can insert up to 10 values.

For '#'-type fields, the value is truncated according to the total number of number-sign characters in String. For '%'-type fields, the full length of the value is printed.

Expand imageRemarks

Expand imageProgramming Guidelines

Expand imageExample

Expand imageSee Also