Dialog.Error(Text [, Any,...]) Method
Version: Available or changed with runtime version 1.0.
Displays an error message and ends the execution of AL code.
Dialog.Error(Message: Text [, Value: Any,...])
This method can be invoked without specifying the data type name.
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.
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.
The window is automatically sized to hold the longest line of text and total number of lines. By calling the method with an empty string the execution of AL code ends without displaying a message.
We recommend the following guidelines for error messages:
Describe what is wrong and how to solve the problem.
Write a short descriptive message. Do not use more words than necessary.
Always end the error message with a period.
Use a text constant for the text of the message.
For more information, see Progress Windows, Message, Error, and Confirm Methods.
This example shows how to use the
var AccountNo: Integer; Text000: Label 'Finance Account #1#### must not be blocked.'; Text001: Label 'Placeholder message.'; begin AccountNo := 1230; // The execution stops when the error statement is executed // and all following statements will never be executed. Error(Text000, AccountNo); Message(Text001); // This line is not executed. end;
The error window displays the following:
Finance Account 1230 must not be blocked.
Error method causes execution of AL code to stop. Message Method is never executed.
Dialog Data Type
Get Started with AL
Analyzing Error Method Telemetry
Submit and view feedback for