ErrorInfo.TableId([Integer]) Method
Version: Available or changed with runtime version 8.0.
Specifies the table ID that the error relates to.
Syntax
[TableId := ] ErrorInfo.TableId([TableId: Integer])
Note
This method can be invoked using property access syntax.
Parameters
ErrorInfo
Type: ErrorInfo
An instance of the ErrorInfo data type.
[Optional] TableId
Type: Integer
The table ID of the ErrorInfo
Return Value
[Optional] TableId
Type: Integer
The current table ID of the ErrorInfo.
Remark
You can use the TableId
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 Actionable errors.
For more information about how to handle multiple collected errors, see Collecting errors.
Example (get the TableId property)
procedure myErrorHandlerProc(MyErrorInfo: ErrorInfo)
var
TheTableId: Integer;
begin
TheTableId := MyErrorInfo.TableId();
// do something with the data (now we now the table ID for the row)
end
Example (set the TableId property)
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
Actionable errors
Collecting Errors
Error handling
Get Started with AL
Developing Extensions