{"title":"Dialog.Confirm(Text [, Boolean] [, Any,...]) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/dialog/dialog-confirm-method/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/dialog/dialog-confirm-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/dialog/dialog-confirm-method","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Creates a dialog box that prompts the user for a yes or no answer.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"Dialog.Confirm(Text [, Boolean] [, Any,...]) Method","slug":"dialogconfirmtext-boolean-any-method","at":0,"chars":2021},{"level":2,"title":"Syntax","slug":"syntax","at":223,"chars":173},{"level":2,"title":"Parameters","slug":"parameters","at":396,"chars":440},{"level":2,"title":"Return Value","slug":"return-value","at":836,"chars":54},{"level":2,"title":"Remarks","slug":"remarks","at":890,"chars":381},{"level":2,"title":"Example","slug":"example","at":1271,"chars":616},{"level":2,"title":"Related information","slug":"related-information","at":1887,"chars":134}],"text":"# Dialog.Confirm(Text [, Boolean] [, Any,...]) Method\n> Version: _Available or changed with runtime version 1.0._\nCreates a dialog box that prompts the user for a yes or no answer. The dialog box is centered on the screen.\n## Syntax\n```al\nOk :=   Dialog.Confirm(String: Text [, Default: Boolean] [, Value1: Any,...])\n```\n> NOTE\n> This method can be invoked without specifying the data type name.\n## Parameters\nString\nType: ../text/text-data-type\nSpecifies the string that is displayed in the dialog box. Use a backslash (\\\\) to indicate a new line. The string can be a label that is enabled for multilanguage functionality.\n*[Optional] Default*\nType: ../boolean/boolean-data-type\nSpecifies the default button. If you do not specify a default button, then No is used as the default button.\n*[Optional] Value1*\nType: ../any/any-data-type\n## Return Value\nOk\nType: ../boolean/boolean-data-type\n## Remarks\nThe message window is automatically sized. The height of the window corresponds to the number of lines and the width corresponds to the length of the longest line.\nWe recommend that you always end Confirm messages with a question mark. For more information about best practices for end-user messages, see ../../devenv-progress-windows-message-error-and-confirm-methods.\n## Example\nIn the following example, the Dialog.Confirm method prompts the user for a true or false answer.\n```al\nvar\n    Question: Text;\n    Answer: Boolean;\n    CustomerNo: Integer;\n    Text000: Label 'Exit without saving changes to customer %1?';\n    Text001: Label 'You selected %1.';\nbegin\n    CustomerNo := 01121212;\n    Question := Text000;\n    Answer := Dialog.Confirm(Question, true, CustomerNo);\n    Message(Text001, Answer);\nend;\n```\nThe first dialog box shows:\nExit without saving changes to customer 1121212?\nIf you select the default true value, then the second dialog box is shown:\nYou selected true.\n## Related information\ndialog-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}