Progress windows and the message, error, and confirm methods
You can use several specialized methods to display messages and gather input. We recommend that you use pages to ensure that your application has a consistent user interface. However, certain situations might occur where you'll want to use the dialog methods instead of pages.
The most important uses of the dialog methods are to:
Display a window that indicates the progress of some processing that might take a long time.
Stop the running program to display an error message.
Let the user confirm a choice before the program continues running.
You can also use the StrMenu method to create pages that present options to the user. Using this method is quicker than designing a page that only presents a limited set of options to the user. For more information, see StrMenu Method.
We recommend that you use the following guidelines for writing messages for users:
Write messages correctly according to the grammatical rules for your language.
Avoid using backslashes to indicate line breaks in a message. Line formatting is completed automatically. The only exception is in the Open Method, where you'll need to use backslashes for the message to align correctly.
Use the FieldCaption Method and TableCaption Method whenever possible to return names of fields and tables as strings so that the user can always recognize a term that indicates a field or table name. The only exception to this guideline is with the Open Method. In this method, you can use the field name directly. Otherwise, it can be difficult to align correctly. If you refer to a field name without using the FieldCaption method, then you'll need to enter the field name without single or double quotation marks.
Try writing all messages on only one line. If you want to use more than one line, then start each new line after a period instead of in the middle of a sentence.
Avoid entering the text directly in the AL code. Instead, enter it as a label so that the message can be translated.
If you have an application that performs some processing that can take a long time to complete, then you should consider displaying a window that informs the user of the progress that's being made. It's always a good idea to inform the user that processes are still running.
A Cancel button is automatically added to every dialog window and gives the user the opportunity to stop the processing.
In some applications, you might want to create a window in which each field is updated when the program is running. For example, the fields in the window display the count of the number of postings made. In another application, you might want to display information about the record that is currently being processed. For example, the field in the window displays the number of the account that is currently being processed.
To create this type of progress window, you can use the Dialog data type.
For more information, see the Interaction functions unit of the Work with AL built-in functions in Dynamics 365 Business Central module.