New Functionality In Microsoft Dynamics 365 Business Central 2024 Wave 2: Display Errors And Messages In Copilot Prompt Dialogs

Microsoft Dynamics 365 Business CentralThis post is part of the New Functionality In Microsoft Dynamics 365 Business Central 2024 Wave 2 series in which I am taking a look at the new functionality introduced in Microsoft Dynamics 365 Business Central 2024 Wave 2.

The 12th of the new functionality in the Copilot and AI innovation section is display errors and messages in Copilot prompt dialogs.

Users learning to work with Copilot often need a simple and effective feedback loop to help them experiment and make the most out of their AI-powered assistant.

Copilot features that display a prompt dialog can now show errors and messages directly inside the dialog. While prompt dialogs aren’t intended for conversational experiences, the integrated feedback keeps users focused on the dialog without distraction.

Enabled for: Users, automatically
Public Preview: Oct 2024
General Availability: Oct 2024

Feature Details

Errors and messages that are thrown by the code logic in Copilot prompt dialogs now surface directly inside the dialog rather than in a separate pop-up dialog. There’s no additional work required by developers to enable this feature, apart from authoring proper error handling and warnings as you already do today. Both the classic Dialog.Error() and Dialog.Message(), as well as the newer ErrorInfo patterns are supported. In the case of the latter, the title and description will both be shown.

If the code throws more than one message, only the latest will be shown, but the user is told that there were multiple issues. Also, as has already been the case, if an error is thrown, a subsequent message will be suppressed. If the error or message contains line breaks, these are ignored, as opposed to rendering in dialogs.

Example 1: Rendering multiple messages thrown by Message() while in the prompt dialog

The following code snippet illustrates throwing multiple messages, using Message(), when the user chooses the Generate button in a prompt dialog.

page 50110 PromptDialog
{
    PageType = PromptDialog;

    layout
    { ... }

    actions
    {
        area(SystemActions)
        {
            systemaction(Generate)
            {
                trigger OnAction()
                begin
                    Message('First message, which is not shown in the prompt dialog');
                    Message('Last message, which is shown in the prompt dialog');
                end;
            }
        }
    }
}

As a result, when invoking the Generate action in the Copilot prompt dialog, the last message is rendered inline in the Copilot prompt dialog, along with an indication that there were more messages.

Example of rendering a message in the prompt dialog

Example 2: Rendering an error thrown by Error() while in the prompt dialog

Here Microsoft instead change to throwing an Error():

page 50110 PromptDialog
{
    PageType = PromptDialog;

    layout
    { ... }

    actions
    {
        area(SystemActions)
        {
            systemaction(Generate)
            {
                trigger OnAction()
                begin
                    Error('This is an example of rendering an error that happens in the prompt dialog, e.g., during Generate');
                end;
            }
        }
    }
}

In this case, the error is rendered inline:

Example of rendering error thrown in prompt dialog

Example 3: Rendering an error thrown by ErrorInfo while in the prompt dialog

The final example illustrates using the recent ErrorInfo type.

page 50110 PromptDialog
{
    PageType = PromptDialog;

    layout
    { ... }

    actions
    {
        area(SystemActions)
        {
            systemaction(Generate)
            {
                trigger OnAction()
                var
                    ErrorInfo: ErrorInfo;
                begin
                    ErrorInfo.Title('Error info title');
                    ErrorInfo.Message('Error message');
                    ErrorInfo.DetailedMessage('Detailed error');

                    Error(ErrorInfo);
                end;
            }
        }
    }
}

In this case, the ErrorInfo message part is rendered inline, and the title part is used for the tooltip. The detailed message is ignored.

Example of rendering ErrorInfo in prompt dialog

Click to show/hide the New Functionality In Microsoft Dynamics 365 Business Central 2024 Wave 2 Series Index

New Functionality In Microsoft Dynamics 365 Business Central 2024 Wave 2
Auto-Apply Templates When You Synchronize Data With Dataverse
Use New Reports And Demo Data for Financial Reporting
Manage Subscription Billing and Revenue and Expense Recognition
Integrate Field Service with Service Management
Archive Service Management Documents
View Item Availability in Field Service Work Orders
Export Posted Sales Invoices to Shopify
Replenish Items for Projects
Reconcile Payment Transactions in Shopify with Invoices
Use Directed Put-Away and Pick Warehouses with Projects
Capture Data from E-Docs with Azure AI Document Intelligence
Add Invoice and Receipt Documents to E-Documents in Bulk
Import, Export Product Info Using Shopify Metafields
Define Shipping Information For Shopify Shipping Fees
Enable Locations In Shopify Refunds
See Improved Usability For Service And Projects
Allow More Than One User To Post Warehouse Entries at a Time
Add An Item As A Shopify Variant
Use Excel Reports For Consolidation And Fixed Assets
Synchronize Product Translations To Shopify
Use Specific Prices And Discounts When Synchronizing Prices In Shopify
Add Extended Text To Project Planning Lines
Use A Default Quantity Of 1 For Accounts On Documents
Suggest Number Series with Copilot
Chat with Copilot and Learn to Use Installed Add-On Apps
Complete Bank Account Reconciliation Faster with Copilot
Create Product Information Faster with Copilot
Summarize Any Record with Copilot
Experience Enhancements to Analysis Assist with Copilot
Start Using Copilot Without Having to Set Things Up
Create Sales Lines Easily with Copilot
Automate Tests for Your Copilot Extensions with the Business Central Test Toolkit
Start Creating Power Automate Flows With Copilot
Raise Awareness Of Copilot Actions On Card, Document, And Listplus Pages
Display Errors And Messages In Copilot Prompt Dialogs
Experience Enhancements To Chat With Copilot
Start Using Integration with IRS for 1099 Submissions
Start Using E-Documents Framework Localized for Germany
Enable Additional Countries and Regions
Show Features With Demo Dataset For Czechia
Set Up Easier In-Client Performance Profiling with Rules
Use the Ternary Operator when Coding in the AL Language
Pull Extension Source from GitHub when Opening Visual Studio Code from the Web Client
Use the 'This' Keyword for CodeUnit Self Reference
Restore Extensions if Publishing from Visual Studio Code Fails
Use Improved Features for Report Documents
Package Resources in Extensions and Access from AL
Run Code Action for 'With' for File, Project, or Workspace
Type Testing and Casting Operators for Interfaces
Extend Al Interfaces
Extend and Customize Profiles from Other Extensions
Manage Environment Updates More Flexibly
Migrate Record Links and Notes with Cloud Migration Tooling
Manage Per-Tenant Extensions in Admin Center
View App Compatibility with Future Versions in Admin Center
Get Notified About Issues with Job Queue Background Processing
Get List of Manageable Environments for Microsoft Entra Apps
Support IPv6 for Enhanced Security and Scalability
Encrypt Data At-Rest With Customer-Managed Encryption Key
Use E-Documents with Power Automate
Use Multiple VAT Numbers for a Customer
Achieve Sustainability Scorecards and Goals
Navigate the Sustainability Manager Role Center with Ease
Add Attachments When You Send Electronic Documents
Record Greenhouse Gas Emissions Using Purchase Invoices
Report Sustainability Entries with Financial Reports
Use New Service Providers in the E-Documents Framework
Purchase Carbon Credits
Enable Internal Carbon Fee Calculation in Sustainability
Track Sustainability Certificates For Items And Vendors
Use Embedded Power Bi Reports Out Of The Box
Do Ad Hoc Analysis On Fixed Assets, Projects, And Services
Use Advanced Settings In The Power Bi Connector
Access Keys with Key Tips In More Languages
Use Drag and Drop On File Upload Dialog to Attach Multiple Files
Resize Columns Even when Personalization isn't Enabled

What should we write about next?

If there is a topic which fits the typical ones of this site, which you would like to see me write about, please use the form, below, to submit your idea.

Your Name

Your Email

Suggested Topic

Suggestion Details

Leave a Reply

Your email address will not be published. Required fields are marked *