{"title":"Customize generate mode caption of the prompt dialog page","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/copilot-customize-generate-mode/","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/copilot-customize-generate-mode, 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/copilot-customize-generate-mode","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":"Learn how to change the caption progress bar shown in the UI of the prompt dialog page in generate mode.","date":"2026-10-02","meta":{"topic":"how-to"},"outline":[{"level":1,"title":"Customize generate mode caption of the prompt dialog page","slug":"customize-generate-mode-caption-of-the-prompt-dialog-page","at":0,"chars":3593},{"level":2,"title":"How to change the caption","slug":"how-to-change-the-caption","at":969,"chars":321},{"level":2,"title":"Example: From the OnAction() trigger","slug":"example-from-the-onaction-trigger","at":1290,"chars":1099},{"level":2,"title":"Example: From the RunGeneration() procedure","slug":"example-from-the-rungeneration-procedure","at":2389,"chars":1057},{"level":2,"title":"Next steps","slug":"next-steps","at":3446,"chars":147}],"text":"# Customize generate mode caption of the prompt dialog page\nIn this article, you learn how to change the caption shown in the UI when Copilot is retrieving generated results from the Azure OpenAI service. The UI is defined by the generate mode of the prompt dialog page. Its purpose is to give users feedback about what's happening with Copilot. The caption functions as a kind of progress bar for the user. By default, the caption of PromptDialog page when it's in the generate mode is Generating, as illustrated in the following figure:\n![Shows a screenshot of the default generate mode of the PromptDialog type page]<https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/media/promptdialog-generate-mode.svg#lightbox>\nCustomizing the caption enables you to give users more specific feedback about what Copilot is doing or how it's progressing. This feedback is especially useful if the Copilot consists of multiple steps or takes a long time.\n## How to change the caption\nYou customize the caption by using the methods-auto/dialog/dialog-open-method or methods-auto/dialog/dialog-update-method methods.\nThere are different ways to use the `Dialog.Open()`and `Dialog.Update()` to change the generate mode's caption. Refer to the following examples for inspiration.\n## Example: From the OnAction() trigger\nThe following code example illustrates how to change the generate mode caption directly from the `OnAction()` trigger of Generate and Regenerate actions. The code snippets use the `OnAction()` trigger to change the caption to:\n Creating a draft for you... when generating the first draft with Copilot.\n Revising the draft for you... when regenerating a draft.\n```al\nsystemaction(Generate)\n{\n    trigger OnAction()\n    var\n        GenerateModeProgress: Dialog;\n    begin\n        GenerateModeProgress.Open('Creating a draft for you...');\n    end;\n}\n\nsystemaction(Regenerate)\n{\n    trigger OnAction()\n    var\n        GenerateModeProgress: Dialog;\n    begin\n        GenerateModeProgress.Open('Revising the draft...');\n    end;\n}\n\n```\nThe following figures illustrate the customized captions in the UI:\n<https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/media/promptdialog-generate-mode-custom.svg#lightbox>\n<https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/media/generate-mode-caption-revising.svg#lightbox>\n## Example: From the RunGeneration() procedure\nThis example changes the generate mode caption by calling the `Dialog.Open()` method from the procedure that generates the results (for purposes of this article, the `RunGeneration()`).\n```al\nsystemaction(Generate)\n{\n    Caption = 'Generate';\n\n    trigger OnAction()\n    begin\n        RunGenerate(CopilotGeneratingTxt);\n    end;\n}\nsystemaction(Regenerate)\n{\n    Caption = 'Regenerate';\n    trigger OnAction()\n    begin\n        RunGenerate(CopilotRegeneratingTxt);\n    end;\n}\n```\n```al\nlocal procedure RunGenerate(ProgressTxt: Text)\nbegin\n    GenerateModeProgress.Open(ProgressTxt);\n    ...\n\nend;\n```\n```al\nvar\n    GenerateModeProgress: Dialog;\n    CopilotGeneratingTxt: Label 'Creating a draft for you...';\n    CopilotRegeneratingTxt: Label 'Revising the draft...';\n```\nFor a more comprehensive example, go to Advanced_SuggestJob sample on GitHub<https://github.com/microsoft/BCTech/blob/002affcf1520a710c270257d6547e25a9a223e85/samples/AzureOpenAI/Advanced_SuggestJob/DescribeJob/CopilotJobProposal.Page.al>.\n## Next steps\n copilot-design-prompt-mode\n copilot-design-content-mode\n Launch Copilot prompt dialog page<devenv-page-prompting-floating-actionbar>"}