# ErrorInfo.RecordId([RecordId]) Method
> Version: _Available or changed with runtime version 8.0._
Specifies the record ID of the record that the error relates to.
## Syntax
```al
[RecordId := ]  ErrorInfo.RecordId([RecordId: RecordId])
```
> NOTE
> This method can be invoked using property access syntax.
## Parameters
ErrorInfo
Type: errorinfo-data-type
An instance of the errorinfo-data-type data type.
*[Optional] RecordId*
Type: ../recordid/recordid-data-type
The record ID of the ErrorInfo
## Return Value
*[Optional] RecordId*
Type: ../recordid/recordid-data-type
The current record ID of the ErrorInfo.
## Remark
You can use the RecordId property 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/show-it actions or where you handle collected errors.
For more information about how to develop actionable errors, see ../../devenv-actionable-errors.
For more information about how to handle multiple collected errors, see Collecting errors<../../devenv-error-collection>.
## Example (get the RecordId property)
```al
procedure myErrorHandlerProc(MyErrorInfo: ErrorInfo)
var
    TheRecordId: RecordId;
begin
    TheRecordId := MyErrorInfo.RecordId();

    // do something with the data (now you can get the table number of the row or a record ref to the row)
end
```
## Example (set the RecordId property)
```al

var
    MyErrorInfo: ErrorInfo;
    MyTableRec: Record "MyTable";
begin
    // setup the error info object: Define Message, DetailedMessage etc.

    // set identifiers for the fix-it action codeunit (or for the AL runtime in case of a show-it action)
    MyErrorInfo.RecordId := MyTableRec.RecordId;
    MyErrorInfo.SystemId := MyTableRec.SystemId;
    MyErrorInfo.TableId := Database::"MyTable";

    // setup fix-it or show-it action(s) for the error info object

    Error(MyErrorInfo);
end
```
## Related information
errorinfo-data-type
../../devenv-actionable-errors
Collecting Errors<../../devenv-error-collection>
../../devenv-al-error-handling
Get 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-recordid-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-recordid-method/
