We have a new Page Type: PromptDialog in AL

As part of the AI/CoPilot rollout, Microsoft has decided to wrap the prompt process into a separate page type. In this video, I go poke at the page type and see what it can do. Check out the video:

https://youtu.be/pW5r4dbjDIQ

In this video, Erik explores the brand-new PromptDialog page type in AL for Business Central — fresh off the excitement of Directions EMEA in France, where AI and Copilot were the dominant themes. He walks through creating a PromptDialog page from scratch, discovering its properties, layout areas, and system actions, all while working against a pre-release version of BC (23.1). This is a hands-on, exploratory session with no documentation to lean on.

Back from Directions: AI and Copilot Everywhere

Erik kicks off by sharing his experience at Directions EMEA in France — it was great meeting viewers in person for a change. The overarching theme of the event was clear: AI and Copilot. As Erik puts it, if you grabbed any Microsoft employee and squeezed them a bit, the words that would come out would be “AI” or “Copilot.”

One of the standout things demonstrated at Directions was a new type of page in Business Central that behaved very differently from all the other pages. And it was actually a suggestion from a Microsoft employee that prompted this video: “Hey Erik, I think you should do a video on the PromptDialog page.”

Setting Up: Runtime 12.1 Required

The PromptDialog page type is not available in version 23.0 — it’s new in 23.1, which at the time of recording was the upcoming next minor release. To use it, you need to set your runtime to 12.1 in your app.json:

{
  "id": "21734f31-c606-403d-b881-680d5c445d21",
  "name": "promptdialog",
  "publisher": "Default publisher",
  "version": "1.0.0.0",
  "dependencies": [],
  "platform": "1.0.0.0",
  "application": "23.0.0.0",
  "idRanges": [
    {
      "from": 50100,
      "to": 50149
    }
  ],
  "resourceExposurePolicy": {
    "allowDebugging": true,
    "allowDownloadingSource": true,
    "includeSourceInSymbolFile": true
  },
  "runtime": "12.1",
  "features": [
    "NoImplicitWith"
  ]
}

If you try this on a 23.0 environment, it won’t work — the page type simply won’t be available. Erik ran this against the “next minor” preview, which you can obtain through BC Container Helper without needing any special insider keys.

Creating the PromptDialog Page

The first discovery: a PromptDialog page must have the property Extensible = false. Erik is not a fan of this requirement — he argues that the only pages that should be non-extensible are things like credential input or password pages where you don’t want anyone to snoop. For a general-purpose page type used to ask something and get an answer, it seems like an odd restriction.

Key Properties

Several important properties come into play with PromptDialog pages:

  • PageType = PromptDialog — the new page type
  • Extensible = false — required, or it won’t compile
  • PromptMode — can be set to Prompt, Generate, or Content
  • IsPreview — “Specifies if the page is available as part of a preview release” (Erik wasn’t entirely sure what practical difference this makes)
  • SourceTable — optional, but if used, it must be temporary (SourceTableTemporary = true)

PromptMode Explained

The three prompt modes behave quite differently:

  1. Prompt — Prompts the user for input for the Copilot interaction. This shows an input area where the user can type.
  2. Generate — Calls the Generate system action the moment the page opens. The page immediately enters a “generating” state with a progress animation.
  3. Content — Displays the content/result area. You can also set this programmatically via the CurrPage.PromptMode variable before the page is opened.

Source Table Behavior

The meaning of the source table is different from other page types. According to the BC Tech repository documentation Erik found: the source table should represent an instance of a Copilot suggestion that can include both the user input and the Copilot result. You should insert a new record each time the user tries to regenerate a suggestion. The Business Central web client will then show a history control that allows the user to go back and forth between different suggestions and choose the best one to save.

Layout Areas: Prompt and Content

The PromptDialog page introduces two special layout areas beyond the standard Content:

  • area(Prompt) — Where the user types their input
  • area(Content) — Where the generated results are displayed

Erik discovered through trial and error that repeater controls are not allowed directly in the Content area for PromptDialog pages. If you need to display a list of results, you must use a subpage (ListPart) instead.

System Actions

Instead of regular actions, PromptDialog pages use system actions. You cannot place a normal action inside a SystemActions area — the compiler will stop you. The available system actions are:

  • Generate — Triggered when the user clicks the generate button
  • Regenerate — For regenerating a new suggestion
  • Cancel — For cancelling the operation
  • Attach — Used to include attachments to the prompt input area
  • OK — To accept/keep the result

When the Generate action fires, the page automatically transitions from the Prompt view to the Content view, showing “Keep it” and “Discard” options to the user.

The Final Code

Here’s the PromptDialog page Erik built during the session:

page 50100 "Prompt Dialog Test"
{
    PageType = PromptDialog;
    Extensible = false;
    Caption = 'Prompt Test';
    PromptMode = Prompt;
    SourceTable = Item;
    SourceTableTemporary = true;

    layout
    {
        area(Prompt)
        {
            field(P; P)
            {
                ShowCaption = false;
                MultiLine = true;
                ApplicationArea = All;
            }
        }
        area(Content)
        {
            part(Items; "Item SubList")
            {
                ApplicationArea = All;
            }
        }
    }
    actions
    {
        area(SystemActions)
        {
            systemaction(Generate)
            {
                Caption = 'Do something!';
                trigger OnAction()
                begin
                    c := '42';
                    Sleep(5000);
                end;
            }
        }
    }
    var
        P: Text;
        C: Text;
}

And the supporting subpage for displaying item data in the content area:

page 50101 "Item SubList"
{
    PageType = ListPart;
    SourceTable = Item;
    layout
    {
        area(Content)
        {
            repeater(Rep)
            {
                field("No."; Rec."No.")
                {
                    ApplicationArea = All;
                    ToolTip = 'Specifies the number of the involved entry or record, according to the specified number series.';
                }
                field("Net Change"; Rec."Net Change")
                {
                    ApplicationArea = All;
                    ToolTip = 'Specifies the value of the Net Change field.';
                }
                field(Description; Rec.Description)
                {
                    ApplicationArea = All;
                    ToolTip = 'Specifies what you are selling.';
                }
                field("Unit Cost"; Rec."Unit Cost")
                {
                    ApplicationArea = All;
                    ToolTip = 'Specifies the cost of one unit of the item or resource on the line.';
                }
                field("Unit Price"; Rec."Unit Price")
                {
                    ApplicationArea = All;
                    ToolTip = 'Specifies the price for one unit.';
                }
            }
        }
    }
}

How It Behaves in the Browser

When running the page in PromptDialog mode, here’s what Erik observed:

  1. The page opens with a Copilot-styled icon and a text input area (the Prompt area)
  2. You type your prompt and click the “Do something!” generate button
  3. The page transitions into a generating state with a nice animated progress indicator
  4. After the Sleep(5000) completes, the page switches to the Content view showing the result
  5. The user sees “Keep it” and “Discard” options
  6. There’s also a standard “AI generated content may be incorrect” disclaimer and links for Terms of Use and Learn More (though the links didn’t work in this preview environment)

Erik added a Sleep(5000) call in the Generate action to simulate the delay of an actual AI call — and it produced a satisfying “really calculating” animation before revealing the answer: 42 (the answer to life, the universe, and everything).

Key Takeaways

  • The PromptDialog page type is only available from runtime 12.1 (BC 23.1) onwards — it will not work on 23.0
  • It must be non-extensible (Extensible = false)
  • It’s clearly designed with Copilot/AI interactions in mind — the UI includes Copilot branding, AI disclaimers, and a prompt-generate-review workflow
  • The page uses special layout areas (Prompt and Content) and system actions instead of regular actions
  • Repeaters are not allowed directly in the Content area — use a ListPart subpage instead
  • If you use a source table, it must be temporary, and it can track multiple suggestion iterations for a history control
  • At the time of recording, there was no official documentation — Erik pieced everything together from the BC Tech GitHub repository’s item substitution demo

This is a very purpose-built page type, clearly tailored for the Copilot experience. Whether it can be repurposed for non-AI scenarios remains to be seen, but the tight constraints (non-extensible, specific layout areas, AI disclaimers) suggest Microsoft designed it with a very specific use case in mind.