Business Central 2024 wave 2 (BC25): Display errors and messages in Copilot prompt dialogs

Dynamics 365 Business Central

Hi, Readers.
Dynamics 365 Business Central 2024 wave 2 (BC25) is generally available. More details: General availability: Dynamics 365 Business Central 2024 release wave 2 (BC25).

I will continue to test and share some new features that I hope will be helpful.

Display errors and messages in Copilot prompt dialogs:

Business value:
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.

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.

https://learn.microsoft.com/en-us/dynamics365/release-plan/2024wave2/smb/dynamics365-business-central/display-errors-messages-copilot-prompt-dialogs?wt.mc_id=DX-MVP-5004336

Microsoft Dynamics 365 Copilot enables professionals to perform their day-to-day work with the assistance of cutting-edge AI by their side. With Copilot in Business Central, customers empower their workers with intuitive AI tools to get more done with less effort, without needing to become data scientists. More details: Transform the way work gets done with Microsoft Copilot in Dynamics 365 Business Central

With Business Central 2023 release wave 2 (BC23.1), Microsoft released a new page type, PromptDialog page type. More details: Dynamics 365 Business Central: PromptDialog page type (Integrate copilot capabilities)

With this wave (BC25), copilot features that display a prompt dialog can now show errors and messages directly inside the dialog. For example, an error message in the recently released Suggest number series with Copilot feature. More details: Business Central 2024 wave 2 (BC25): Suggest number series with Copilot

Let’s look at a few examples provided by Microsoft.

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.

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 2: Rendering an error thrown by Error() while in the prompt dialog

In this case, the error is rendered inline:

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

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

PS: This does not support ErrorInfo actions. More details: Business Central 2023 wave 1 (BC22) new features: Provide Title and custom actions to Error dialogs (Custom Actions in error messages)

PS: If you use Confirm(), the dialog box will be displayed outside the prompt dialog.

Great, give it a try!!!😁

PS:
1. Business Central 2024 wave 1 (BC24): Copilot prompt actions (Floating action bar)

2. Business Central 2024 wave 2 (BC25): Use Copilot prompt actions on Document, Card and ListPlus pages

END

Hope this will help.

Thanks for reading.

ZHU

コメント

Copied title and URL