Error messages can get in the way of completing a task—for example, if the task you’re performing requires a setting that’s missing on another page. Sometimes the fix is easy, but not obvious.

What Are Actionable Errors?

Actionable errors are a type of error message in Business Central that not only inform users of an issue but also provide options to resolve it directly from the error message. This innovation transforms the error handling process from a mere notification system to a proactive problem-solving tool.

Example of the Actionable Error Message in Business Central

When is this feature released?

Enabled forPublic previewGeneral availability
Users, automatically Apr 1, 2023 Jul 7, 2023
When the feature started to be active

Before continuing further, make sure you watch the following video regards Actionable Error Messages:

Microsoft video on topic Use actionable error messages to unblock users

There are three Error Types:

Error typeDescription
Task dialogsTask dialogs are used when an error can be mitigated by the user choosing between two (sometimes three) different options to continue their task without encountering an error.
Error messages with Fix-it actionsFix-it actions can be used when the cause and solution to the error is known and can be solved by users with just one step.
Error messages with Show-it actionsShow-it actions can be used when an error must be corrected on a related table. A Show-it action can then offer a shortcut to the related table, enabling users to correct the error by themselves with one or multiple steps, while keeping the context of their current task.

Error messages with Fix-it actions

Fix-it actions are intended for situations where the correct value is already known. If all the following four conditions apply to your error scenario, consider incorporating a recommended Fix-it action in your error message. This will help users quickly resolve the issue and move forward.

Example (error dialog with a Fix-it action)

var 
    dimension: Text[30];
    vendorCode: Text[30];
    FixitErrorInfo: ErrorInfo;
begin
    // setup the error info object
    FixitErrorInfo.Title('The line dimension value isn''t valid');
    FixitErrorInfo.Message(
        StrSubstNo('The dimension value must be blank for the dimension %1 for Vendor %2', dimension, vendorCode)
    );
    FixitErrorInfo.DetailedMessage('Add some text to help the person troubleshooting this error.');

    FixitErrorInfo.AddAction(
        'Set value to blank', 
        Codeunit::FixitCodeunit, 
        FixitCodeunitMethodName
    );
    
    Error(FixitErrorInfo);
end

If users encounter the error, they will see the following error dialog:

If you perform validation and users find that the field cannot be validated, they will see the following dialog::

Error messages with Show-it actions

Show-it actions are intended for when the error location is known. In such cases, a shortcut can be provided to display the relevant page, helping users quickly resolve the issue. If all the following four conditions apply to your error scenario, consider adding a recommended Show-it action in your error message.


Example (error dialog with a Show-it action)

procedure ShowShipmentDialog()
var
    ErrorNoLinesToCreate: ErrorInfo;
    SomeCheckCondition: Boolean;
begin
    // some business logic 

    SomeCheckCondition := // calculate if true or false        

    if (SomeCheckCondition)
    begin
        // maybe some business logic here 

        // setup the error info object
        ErrorNoLinesToCreate.Title := 'There are no new warehouse shipment lines to create';
        ErrorNoLinesToCreate.Message := 'This usually happens when warehouse shipment lines [...]'; 
        ErrorNoLinesToCreate.DetailedMessage('Add some text to help the person troubleshooting this error.');

        ErrorNoLinesToCreate.PageNo := Page::"Warehouse Shipment List";
        ErrorNoLinesToCreate.AddNavigationAction('Show open lines');,

        Error(ErrorNoLinesToCreate);

        // maybe more business logic here 
    end;

    // some more business logic here

If users encounter the error, they will see the following error dialog:

If you perform validation and users encounter an unvalidated field, they will see the following dialog:

Error messages with multiple actions

Error messages can include up to two recommended actions. In this section, we provide various examples of how to use multiple actions and explain the reasoning behind them.


Example (error dialog with two actions)

var
    ErrorDialogWithTwoActions: ErrorInfo;
    DimensionCode: Code[20];
    VendorCode: Code[20];
begin
    // set values for DimensionCode, VendorCode variables

    // setup the error info object
    ErrorDialogWithTwoActions.Title := 'The line dimension value isn''t valid';
    ErrorDialogWithTwoActions.Message := StrSubstNo('The dimension value must be blank for the dimension %1 for Vendor %2', DimensionCode, VendorCode); 
    ErrorDialogWithTwoActions.DetailedMessage('Add some text to help the person troubleshooting this error.');

    ErrorDialogWithTwoActions.AddAction(
        'Set value to blank',
        Codeunit::FirstFixitCodeunit, 
        "FirstFixitCodeunitMethodName"
    );
    ErrorDialogWithTwoActions.AddAction(
        'OK',
        Codeunit::SecondFixitCodeunit, 
        "SecondFixitCodeunitMethodName"
    );

    Error(ErrorDialogWithTwoActions);
end;

If users encounter the error, they will see the following error dialog:

If you perform validation and users encounter a field that cannot be validated, they will see the following dialog:

Validation error with multiple actions

Error messages with no actions

When there is no known solution to recommend, the error dialog will have a primary OK button. Users can copy and share the full error details for troubleshooting and support purposes.

Example

var
    ErrorDialogNoActions: ErrorInfo;
begin
    // setup the error info object
    ErrorDialogNoActions.Title := 'The ''Starting Date'' isn''t valid';
    ErrorDialogNoActions.Message := 'The ''Starting Date'' must be the first date of an accounting period. Try changing the date to first date of the month.'; 
    ErrorDialogNoActions.DetailedMessage('Add some text to help the person troubleshooting this error.');

    Error(ErrorDialogNoActions);
end;

If users encounter the error, they will see the following error dialog:

Error dialog with no solution

Conclusion

Actionable errors represent a significant advancement in error handling within Dynamics 365 Business Central. By transforming error messages into proactive problem-solving tools, businesses can enhance user experience, reduce downtime, increase efficiency, and improve data accuracy. Implementing actionable errors requires thoughtful planning and user-centric design, but the benefits far outweigh the effort. Embrace actionable errors in Business Central to empower your users and streamline your operations.

Categorized in: