{"title":"Dialog.StrMenu(Text [, Integer] [, Text]) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/dialog/dialog-strmenu-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-strmenu-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-strmenu-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 menu window that displays a series of options.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"Dialog.StrMenu(Text [, Integer] [, Text]) Method","slug":"dialogstrmenutext-integer-text-method","at":0,"chars":2008},{"level":2,"title":"Syntax","slug":"syntax","at":168,"chars":198},{"level":2,"title":"Parameters","slug":"parameters","at":366,"chars":620},{"level":2,"title":"Return Value","slug":"return-value","at":986,"chars":190},{"level":2,"title":"Example","slug":"example","at":1176,"chars":698},{"level":2,"title":"Related information","slug":"related-information","at":1874,"chars":134}],"text":"# Dialog.StrMenu(Text [, Integer] [, Text]) Method\n> Version: _Available or changed with runtime version 1.0._\nCreates a menu window that displays a series of options.\n## Syntax\n```al\nOptionNumber :=   Dialog.StrMenu(OptionMembers: Text [, DefaultNumber: Integer] [, Instruction: Text])\n```\n> NOTE\n> This method can be invoked without specifying the data type name.\n## Parameters\nOptionMembers\nType: ../text/text-data-type\nA comma-separated string. Each substring in OptionString specifies an option on the menu. The string can be a label that is enabled for multilanguage functionality.\n*[Optional] DefaultNumber*\nType: ../integer/integer-data-type\nUse this optional parameter to determine a default option, which is highlighted. The options are numbered 1, 2, 3, 4, and so on. If you omit this optional parameter, the first option (1) is used as the default.\n*[Optional] Instruction*\nType: ../text/text-data-type\nUse this optional parameter to add a description to the option values.\n## Return Value\nOptionNumber\nType: ../integer/integer-data-type\nThe number of the menu option that the user selected. If the user presses the Esc key to exit the menu, zero (0) is returned.\n## Example\nThis example shows how to use the Dialog.StrMenu method.\n```al\nvar\n    Options: Text[30];\n    Selected: Integer;\n    Text000: Label 'Save,Delete,Exit,Find';\n    Text001: Label 'You selected option %1.';\n    Text002: Label 'Choose one of the following options:';\nbegin\n    Options := Text000;\n    // Sets the default to option 3\n    Selected := Dialog.StrMenu(Options, 3, Text002);\n    Message(Text001, Selected);\nend;\n```\nThe menu window displays the following text:\nChoose one of the following options:\nSave\nDelete\nExit\nFind\nOption 3, Exit, is highlighted. The option that the user selects is stored in the variable Selected. The user receives following message:\nYou selected option 3.\n## Related information\ndialog-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}