topic hubCopilot & Agentsofficial - Microsoftreviewed - checked by Opus

Build Copilot user experience

Building Copilot user experiences in Business Central with the PromptDialog page type. It covers creating the page, designing prompt, generate and content modes, error handling, and launching Copilot features from prompt actions. It answers how-to questions for AL developers.

Path: Integration with AI > Integrate AI using developer tools for Copilot > Extend Copilot in Business Central > Build Copilot user experience · tier official · system copilot · narrative reviewed (checked by Opus)

Overview

The PromptDialog page type is the basis for Copilot user interfaces in Business Central. A dialog moves through three modes: prompt mode where the user gives input, generate mode while the AI works, and content mode where the user reviews the result and saves or discards it. System actions such as Generate, Regenerate, OK and Cancel drive these steps.

The pages follow that flow. Start with the overview page, then create the page and set its properties. Next, design the prompt mode and content mode, customize the generate mode caption, and handle errors inline. The last page covers prompt actions that open the dialog from other pages.

Most pages are developer how-tos. Read them in order when building a new Copilot feature, or jump to a single page when changing one mode.

Key points

  • PromptDialog pages have three modes: prompt (input), generate (AI processing) and content (review, save or discard).
  • Creating the page sets properties for caption, Extensible, PromptMode and IsPreview.
  • Prompt mode supports a prompt area with fields, InstructionalText placeholder text, prompt guides for predefined prompts, a generate action, file attachment and preference options. The prompt mode page refers to 2024 release wave 2.
  • Content mode shows AI output and offers regenerate, save and discard actions, caption customization, a proposal history carousel and version history.
  • The generate mode caption can be changed with Dialog.Open() or Dialog.Update() to show progress, for example in multi-step Copilots.
  • Dialog.Error(), Dialog.Message() and ErrorInfo can display inline in the prompt dialog instead of popups, with multiple messages, error suppression and message truncation (2024 release wave 2).
  • Prompt actions on List, Card, Document, ListPart, StandardDialog, ListPlus and Worksheet pages open a PromptDialog from the floating action bar, using RunObject, the Sparkle image, SaaS detection and capability registration (2024 release wave 1, runtime 13 and 14).

Learn pages

Source: Microsoft Learn (CC BY 4.0). Descriptions are Learn’s own.

What Learn documents here 7 Learn pages