Email this post as a PDFAI and agents · 5 November 2026 · 3 min read

Building Copilot features in AL: the AI module, prompt dialogs and responsible AI

Business Central extensions can add their own Copilot features using the System Application's Azure OpenAI module and the PromptDialog page type. How a Copilot capability is registered, how the call is made, how the user reviews the result, and the responsible AI requirements Microsoft expects.

Contents
  1. 1. Register a Copilot capability
  2. 2. Call Azure OpenAI through the AI module
  3. 3. Show the result in a PromptDialog
  4. 4. Responsible AI requirements
  5. Good first features

Microsoft built Copilot into Business Central with the same platform pieces available to partners. An extension can add its own Copilot feature, appear in the Copilot capabilities list, use Azure OpenAI through the System Application, and present results in the standard Copilot UI. This is a developer's overview of the moving parts. Check Microsoft's current documentation for exact signatures, because this area moves quickly.

1. Register a Copilot capability

Add a value to the "Copilot Capability" enum with an enum extension, and register it from your install codeunit with the "Copilot Capability" codeunit, giving it a learn-more URL. Registered capabilities appear on the Copilot & agent capabilities page, where administrators can switch them on or off. Check that your capability is active before using it.

2. Call Azure OpenAI through the AI module

The System Application's AI module wraps the service: the "Azure OpenAI" codeunit for the call, "AOAI Chat Messages" for the system and user messages, "AOAI Chat Completion Params" for settings such as temperature and token limits, and "AOAI Operation Response" for the result. You set the capability you're calling for, add a system message describing the task and its constraints, add the user's input and the relevant data, and generate the completion. Microsoft-managed resources are available for some scenarios, or you can authorise against your own Azure OpenAI deployment, with keys held securely (Isolated Storage or Azure Key Vault, never in a table field).

All the system message text is a Label with Locked = true (it must not be translated or the behaviour changes) and every user-facing string a normal label, as with any AL code (see naming).

3. Show the result in a PromptDialog

The PageType = PromptDialog page gives the standard Copilot experience: an input area (the prompt), a generate action, a content area showing the suggestion, and actions to regenerate, keep or discard. Use PromptMode to control whether it opens in prompt or generate mode, and systemaction(Generate), systemaction(OK) and systemaction(Cancel) for the standard buttons. Users then recognise it as Copilot, with the same review-before-use pattern as Microsoft's features.

4. Responsible AI requirements

  • The user reviews before anything is saved. Suggestions are proposals; keeping them is a deliberate action.
  • Say it's AI-generated and that it may be wrong; the PromptDialog does this in the standard UI.
  • Ground the prompt in data from the record, not general knowledge, and constrain it to the task.
  • Don't let it make decisions about people without human review (see AI and data protection).
  • Handle failure: the service can be unavailable, slow or return something unusable. Fail gracefully with a clear message (see error handling).
  • Log usage with telemetry, without logging the prompt content or personal data.
  • For AppSource apps, follow Microsoft's published responsible AI and Copilot validation requirements.

Good first features

Drafting text (descriptions, emails, notes), summarising a record's history, suggesting a classification or category for review, or extracting structured fields from a document. All are bounded, reviewable and useful. Avoid anything that posts or changes financial data on its own.

Email this post as a PDF
A branded PDF of this post, sent to your inbox to keep, print or share. Copy in colleagues if you like.
We only use these addresses to send this PDF. Nobody is added to a mailing list. Mike at Business Boxed receives a copy. See our privacy notice.
Email this post
Talk to us
Want this done in your Business Central?
Book a 30 minute callGet the monthly newsletter

Related posts