# ErrorInfo.AddAction(Text, Integer, Text, Text) Method
> Version: _Available or changed with runtime version 12.0._
Specifies an action for the error.
## Syntax
```al
 ErrorInfo.AddAction(Caption: Text, CodeunitID: Integer, MethodName: Text, Description: Text)
```
## Parameters
ErrorInfo
Type: errorinfo-data-type
An instance of the errorinfo-data-type data type.
Caption
Type: ../text/text-data-type
The text string that appears as the caption of the action in the error UI. The string can be a label that is enabled for multilanguage functionality.
CodeunitID
Type: ../integer/integer-data-type
The ID of the codeunit to run when the action is initiated from the error UI. The codeunit should contain at least one global method to be called by the error action. The global method must have an ErrorInfo data type parameter for accepting the ErrorInfo object.
MethodName
Type: ../text/text-data-type
The name of the method in the codeunit, which is specified by the CodeunitID parameter, that you want to run for the action.
Description
Type: ../text/text-data-type
The text that appears as the tooltip of the action in the error UI.
## Remarks
The semantics of this method is the same as the version without a Description parameter. See AddAction(Text, Integer, Text)<errorinfo-addaction-string-integer-string-method>.
## Related information
errorinfo-data-type
../../devenv-actionable-errors
../../devenv-al-error-handling
Getting Started with AL<../../devenv-get-started>
Developing Extensions<../../devenv-dev-overview>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/errorinfo/errorinfo-addaction-string-integer-string-string-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/errorinfo/errorinfo-addaction-string-integer-string-string-method/
