Skip to content

Latest commit

 

History

History
93 lines (68 loc) · 3.02 KB

errorinfo-customdimensions-method.md

File metadata and controls

93 lines (68 loc) · 3.02 KB
title description ms.author ms.date ms.topic author ms.reviewer
ErrorInfo.CustomDimensions([Dictionary of [Text, Text]]) Method
Set of additional dimensions, specified as a dictionary that relates to the error.
solsen
08/26/2024
reference
SusanneWindfeldPedersen
solsen

ErrorInfo.CustomDimensions([Dictionary of [Text, Text]]) Method

Version: Available or changed with runtime version 8.0.

Set of additional dimensions, specified as a dictionary that relates to the error.

Syntax

[CustomDimensions := ]  ErrorInfo.CustomDimensions([CustomDimensions: Dictionary of [Text, Text]])

Note

This method can be invoked using property access syntax.

Parameters

ErrorInfo
 Type: ErrorInfo
An instance of the ErrorInfo data type.

[Optional] CustomDimensions
 Type: Dictionary of [Text, Text]
The custom dimensions of the ErrorInfo

Return Value

[Optional] CustomDimensions
 Type: Dictionary of [Text, Text]
The current custom dimensions of the ErrorInfo.

Remarks

You can use the CustomDimensions dictionary to transfer data from the code where an error message is shown to the user to the codeunit and method(s) executed by fix-it actions or where you handle collected errors.

For more information about how to develop actionable errors, see Actionable errors. For more information about how to handle multiple collected errors, see Collecting errors.

Example (get the CustomDimensions dictionary)

procedure myErrorHandlerProc( MyErrorInfo: ErrorInfo )
var 
    TheCustomDimensions: Dictionary of [Text, Text];
begin
    TheCustomDimensions := MyErrorInfo.CustomDimensions();

    // do something with the data
end

Example (set the CustomDimensions dictionary property)

var 
    MyErrorInfo: ErrorInfo;
    TheCustomDimensions: Dictionary of [Text, Text];
begin
    // setup the error info object: Define Message, DetailedMessage etc.

    // Populate TheCustomDimensions dictionary with data needed by the fix-it action
    TheCustomDimensions.Add('MyKey', 'Some data');
    TheCustomDimensions.Add('MySecondKey', 'Some more data');
    MyErrorInfo.CustomDimensions(TheCustomDimensions);

    // setup actions for the error info object

    Error(MyErrorInfo);
end

Related information

ErrorInfo Data Type
Actionable errors
Collecting errors
Error handling
Get Started with AL
Developing Extensions