ErrorInfo Data type
Version: Available or changed with runtime version 3.0.
Provides a structure for grouping information about an error.
Static methods
The following methods are available on the ErrorInfo data type.
Method name | Description |
---|---|
Create() | Creates a new ErrorInfo object with Collectible set to true. |
Create(Text [, Boolean] [, var Record] [, Integer] [, Integer] [, Text] [, Verbosity] [, DataClassification] [, Dictionary of [Text, Text]]) | Creates a new ErrorInfo object. |
Instance methods
The following methods are available on instances of the ErrorInfo data type.
Method name | Description |
---|---|
AddAction(Text, Integer, Text) | Specifies an action for the error. |
AddAction(Text, Integer, Text, Text) | Specifies an action for the error. |
AddNavigationAction([Text]) | Adds a navigation action for the error. |
AddNavigationAction([Text] [, Text]) | Adds a navigation action for the error. |
Callstack() | Specifies a callstack where the ErrorInfo was collected. |
Collectible([Boolean]) | Specifies if the error is collectible using ErrorBehavior.Collect. |
ControlName([Text]) | Specifies the control name that the error relates to. |
CustomDimensions([Dictionary of [Text, Text]]) | Set of additional dimensions, specified as a dictionary that relates to the error. |
DataClassification([DataClassification]) | Specifies the classification of the error. Values include 'CustomerContent', 'EndUserIdentifiableInformation', 'EndUserPseudonymousIdentifiers', 'AccountData', 'OrganizationIdentifiableInformation', 'SystemMetadata', and 'ToBeClassified' |
DetailedMessage([Text]) | Specifies a detailed error message. |
ErrorType([ErrorType]) | Specifies type of the error. 'Client' shows the specified message in the client and sends it to telemetry. 'Internal' shows a generic message in the client and sends the specified message to telemetry. |
FieldNo([Integer]) | Specifies the field ID that the error relates to. |
Message([Text]) | Specifies the message that will be sent to telemetry. For a 'Client' error type, the message will also be appear in the client. |
PageNo([Integer]) | Specifies the page number that the error relates to. |
RecordId([RecordId]) | Specifies the record ID of the record that the error relates to. |
SystemId([Guid]) | Specifies the system ID of the record that the error relates to. |
TableId([Integer]) | Specifies the table ID that the error relates to. |
Title([Text]) | Specifies the title of the error. |
Verbosity([Verbosity]) | Specifies the severity level of the error. This can determine whether the error should be sent to telemetry (which is based on the trace level setting of the server). |
Remarks
The different properties in the ErrorInfo
data type are used in different ways for error handling, such as collectable errors, actionable errors, or what is shown in the user interface.
Use this method... | when you want to... |
---|---|
AddAction(Text, Integer, Text) | Used when making the error actionable and adding a fix-it action to the error message. For more information, see Actionable errors. |
AddAction(Text, Integer, Text, Text) | Used when making the error actionable and adding a fix-it action to the error message. For more information, see Actionable errors. |
AddNavigationAction([Text]) | Used when making the error actionable and adding a show-it action to the error message. For more information, see Actionable errors. |
AddNavigationAction([Text] [, Text]) | Used when making the error actionable and adding a show-it action to the error message. For more information, see Actionable errors. |
Collectible([Boolean]) | Make the error collectable and be part of a larger validation scenario. For more information, see Collecting errors. |
ControlName([Text]) | Used when making the error actionable and adding a show-it action to the error message. For more information, see Actionable errors. |
CustomDimensions([Dictionary of [Text, Text]]) | Make the error actionable and add a fix-it action to the error message. The data in CustomDimensions can be used by the codeunit used in the action. For more information, see Actionable errors. |
DetailedMessage([Text]) | Add more details (hidden for the user) for the person who need to troubleshoot the error. |
FieldNo([Integer]) | Used when making the error actionable and adding a show-it action to the error message. For more information, see Actionable errors. |
Message([Text]) | Show a message to the user. For more information, see User experience guidelines for errors |
PageNo([Integer]) | Used when making the error actionable and adding a show-it action to the error message. For more information, see Actionable errors. |
RecordId([RecordId]) | Used when making the error actionable and adding a fix-it action to the error message. For more information, see Actionable errors. |
SystemId([Guid]) | Used when making the error actionable and adding a show-it action to the error message. For more information, see Actionable errors. |
TableId([Integer]) | Specifies the table ID that the error relates to. |
Title([Text]) | Add a title to the error message. Not recommended for validation errors. |
Related information
Error(ErrorInfo) method
Actionable errors
Collecting errors
User experience guidelines for errors
Error handling
Get Started with AL
Developing Extensions