---
title: "Codeunit 28 Error Message Management"
author: "Jonas Paprotka"
url: https://jonas-paprotka.de/ref/codeunit/28-error-message-management/
type: codeunit
id: 28
name: "Error Message Management"
app: "Base Application"
namespace: System.Utilities
versions: "17-28"
build: 28.5.54151.54365
source: "https://jonas-paprotka.de/ref/codeunit/28-error-message-management/source/29/"
checked: 2026-09-20
subject: "Microsoft Dynamics 365 Business Central"
license: "Content © 2026 Jonas Paprotka. Quote freely with attribution and a link."
---

# Codeunit 28 Error Message Management

Jonas Paprotka, https://jonas-paprotka.de/ref/codeunit/28-error-message-management/

| | |
| --- | --- |
| App | Base Application |
| Namespace | System.Utilities |
| Versions | 17-28 |
| Source file | Modules/System/ErrorMessage/ErrorMessageManagement.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| Activate | (var Codeunit Error Message Handler) | Boolean | public | 17-28 | - | - |
| IsActive | () | Boolean | public | 17-28 | - | - |
| Finish | (Variant) | - | public | 17-28 | - | - |
| IsTransactionStopped | () | Boolean | public | 17-28 | - | - |
| ShowErrors | (Notification) | - | public | 17-28 | - | - |
| ThrowError | (Text, Text) | - | public | 17-28 | - | - |
| GetFieldNo | (Integer, Text) | Integer | public | 17-28 | - | - |
| FindFirstErrorMessage | (var Text[250]) | Boolean | public | 17-28 | - | - |
| GetErrors | (var Record Error Message) | Boolean | public | 17-28 | - | - |
| GetErrorsInContext | (Variant, var Record Error Message) | Boolean | public | 17-28 | - | - |
| GetLastError | (var Text[250]) | Integer | public | 17-28 | - | - |
| GetLastErrorID | () | Integer | public | 17-28 | - | - |
| LogError | (Variant, Text, Code[30]) | - | public | 17-28 | - | - |
| LogContextFieldError | (Integer, Text, Variant, Integer, Code[30]) | - | public | 17-28 | - | - |
| LogMessage | (Option, Integer, Text, Variant, Integer, Code[30]) | Boolean | public | 17-28 | - | - |
| LogErrorMessage | (Integer, Text, Variant, Integer, Code[30]) | Boolean | public | 17-28 | - | - |
| LogSimpleErrorMessage | (Text) | Boolean | public | 17-28 | - | - |
| LogTestField | (Variant, Integer) | Boolean | public | 17-28 | - | - |
| LogTestField | (Variant, Integer, Variant) | Boolean | public | 17-28 | - | - |
| LogFieldError | (Variant, Integer, Text) | Boolean | public | 17-28 | - | - |
| LogLastError | () | - | public | 17-28 | - | - |
| GetErrorsFromResultValues | (List, var Record Error Message) | - | public | 17-28 | - | - |
| ParseErrorText | (Text, var Record Error Message) | - | public | 17-28 | - | - |
| ErrorMessage2JSON | (Record Error Message) | Text | public | 17-19 | - | - |
| LogWarning | (Integer, Text, Variant, Integer, Code[30]) | Boolean | public | 17-28 | - | - |
| LogWarning | (Text) | Boolean | public | 17-28 | - | - |
| LogInformation | (Integer, Text, Variant, Integer, Code[30]) | Boolean | public | 17-28 | - | - |
| LogInformation | (Text) | Boolean | public | 17-28 | - | - |
| PushContext | (var Codeunit Error Context Element, Variant, Integer, Text[250]) | Integer | public | 17-28 | - | - |
| GetTopContext | (var Record Error Message) | Boolean | public | 17-28 | - | - |
| ShowErrors | (Guid) | - | public | 18-28 | - | - |
| GetCachedLastErrorID | () | Integer | public | 18-28 | - | - |
| Activate | (var Codeunit Error Message Handler, Boolean) | Boolean | public | 19-28 | - | - |
| FinishTopContext | () | - | public | 19-28 | - | - |
| GetCurrCallStack | () | Text | public | 19-28 | - | - |
| FldRefHasValue | (FieldRef) | Boolean | public | 19-28 | - | - |
| PopContext | (var Codeunit Error Context Element) | Integer | public | 19-28 | - | - |
| GetLastContext | (var Record Error Message) | Boolean | public | 19-28 | - | - |
| CollectErrors | (var Record Error Message) | - | public | 20-28 | - | - |
| ErrorMessage2JSON | (var Record Error Message) | Text | public | 20-28 | - | - |
| PackErrorMessagesToResults | (var Record Error Message, var Dictionary) | - | public | 20-28 | - | - |
| AddSubContextToLastErrorMessage | (Text, Variant) | - | public | 22-28 | - | - |
| InsertTempLineErrorMessage | (var Record Error Message, RecordId, Integer, Integer, Text, Text) | - | public | 24-28 | - | - |
| BuildActionableErrorInfo | (Text, Text, RecordId, Text, Integer, Text) | ErrorInfo | public | 24-28 | - | - |
| BuildActionableErrorInfo | (Text, Text, RecordId, Text, Integer, Text, Text) | ErrorInfo | public | 24-28 | - | - |
| BuildActionableErrorInfo | (Text, Text, Guid, Text, Integer, Text, Text) | ErrorInfo | public | 25-28 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnFindActiveSubscriber | (var Boolean) | 17-28 | - | - |
| Integration event | OnGetFirstContextID | (RecordId, var Integer) | 17-28 | - | - |
| Integration event | OnGetErrors | (var Record Error Message) | 17-28 | - | - |
| Integration event | OnGetLastErrorID | (var Integer, var Text[250]) | 17-28 | - | - |
| Integration event | OnLogSimpleError | (Text, var Boolean) | 17-28 | - | - |
| Integration event | OnLogError | (Option, Integer, Text, Variant, Integer, Code[30], var Boolean) | 17-28 | - | - |
| Integration event | OnPushContext | () | 17-28 | - | - |
| Integration event | OnGetTopElement | (var Integer) | 17-28 | - | - |
| Integration event | OnGetTopContext | (var Record Error Message) | 17-28 | - | - |
| Integration event | OnLogLastError | () | 17-28 | - | - |
| Integration event | OnGetCachedLastErrorID | (var Integer) | 18-28 | - | - |
| Integration event | OnGetTopElementData | (var Integer, var RecordId, var Integer, var Text[250]) | 19-28 | - | - |
| Internal event | OnGetLastErrorMessageRecord | (var Record Error Message) | 22-28 | - | - |
| Integration event | OnBeforeGetContextRecID | (Variant, var RecordId, var Boolean) | 22-28 | - | - |
| Integration event | OnAddToJsonFromErrorMessage | (var JsonObject, var Record Error Message) | 22-28 | - | - |
| Integration event | OnAddToErrorMessageFromJson | (var Record Error Message, var JsonObject) | 22-28 | - | - |
| Integration event | OnAddSubContextToLastErrorMessage | (Text, Variant, var Record Error Message) | 22-28 | - | - |

## Source

Symbols: Microsoft.BaseApplication.symbols.437dbf0e-84ff-417a-965d-ed2bb9650972, https://dynamicssmb2.pkgs.visualstudio.com/DynamicsBCPublicFeeds/_packaging/MSSymbols/nuget/v3/index.json, highest build per major on 2026-09-20.
AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at a66254c3b8b5bb1cea290dc8f9d097aec4381153.

Jonas Paprotka, 2026-09-20.
