Collapse the table of content
Expand the table of content

CONFIRM Function (Dialog)

Creates a dialog box that prompts the user for a yes or no answer. The dialog box is centered on the screen for you.

Ok := Dialog.CONFIRM(String [, Default] [, Value1] ,...)



Type: Code or text constant

Specifies the string that is displayed in the dialog box. Use a backslash (\) to indicate a new line. The string can be a text constant that is enabled for multilanguage functionality. For more information, see Working with Multilanguage Functionality.


Type: Boolean

Specifies the default button. If you do not specify a default, then No is used as the default.

Type: Boolean

true if you entered Yes; otherwise, false.

This return parameter reflects the user's selection.

The message window is sized for you. The height of the window corresponds to the number of lines and the width corresponds to the length of the longest line.

We recommend that you always end CONFIRM messages with a question mark. For more information about best practices for end-user messages, see Progress Windows, MESSAGE, ERROR and CONFIRM Functions.

In the following example, the Dialog.CONFIRM function prompts the user for a Yes or No answer. This code example requires that you create the following variables.

Name Data type





This code example requires that you create the following text constants in the C/AL Globals window.

Name ConstValue


Leave without saving changes?


You selected %1.

Question := Text000;
Answer := Dialog.CONFIRM(Question, TRUE);
MESSAGE(Text001, Answer);

Community Additions

© 2016 Microsoft