Codeunit "Error Message Management"
ID 28
Namespace: System.Utilities
Methods
Activate
procedure Activate(var ErrorMessageHandler: Codeunit "Error Message Handler"): Boolean
Parameters
Returns
Activate
procedure Activate(var ErrorMessageHandler: Codeunit "Error Message Handler"; ClearError: Boolean): Boolean
Parameters
Returns
IsActive
procedure IsActive(): Boolean
Returns
Finish
procedure Finish(ContextVariant: Variant)
Parameters
| Name |
Type |
Description |
|
ContextVariant
|
Variant |
|
FinishTopContext
procedure FinishTopContext()
IsTransactionStopped
procedure IsTransactionStopped(): Boolean
Returns
GetCurrCallStack
procedure GetCurrCallStack(): Text
Returns
ShowErrors
procedure ShowErrors(Notification: Notification)
Parameters
| Name |
Type |
Description |
|
Notification
|
Notification |
|
ShowErrors
procedure ShowErrors(RegisterID: Guid)
Parameters
| Name |
Type |
Description |
|
RegisterID
|
Guid |
|
ThrowError
procedure ThrowError(ContextErrorMessage: Text; DetailedErrorMessage: Text)
Parameters
| Name |
Type |
Description |
|
ContextErrorMessage
|
Text |
|
|
DetailedErrorMessage
|
Text |
|
GetFieldNo
procedure GetFieldNo(TableNo: Integer; FieldName: Text): Integer
Parameters
| Name |
Type |
Description |
|
TableNo
|
Integer |
|
|
FieldName
|
Text |
|
Returns
FindFirstErrorMessage
procedure FindFirstErrorMessage(var ErrorMessage: Text[250]): Boolean
Parameters
| Name |
Type |
Description |
|
ErrorMessage
|
Text[250] |
|
Returns
GetErrors
procedure GetErrors(var TempErrorMessage: Record "Error Message" temporary): Boolean
Parameters
Returns
GetErrorsInContext
procedure GetErrorsInContext(ContextVariant: Variant; var TempErrorMessage: Record "Error Message" temporary): Boolean
Parameters
Returns
GetLastError
procedure GetLastError(var ErrorMessage: Text[250]): Integer
Parameters
| Name |
Type |
Description |
|
ErrorMessage
|
Text[250] |
|
Returns
GetLastErrorID
procedure GetLastErrorID(): Integer
Returns
GetCachedLastErrorID
procedure GetCachedLastErrorID(): Integer
Returns
LogError
procedure LogError(SourceVariant: Variant; ErrorMessage: Text; HelpArticleCode: Code[30])
Parameters
| Name |
Type |
Description |
|
SourceVariant
|
Variant |
|
|
ErrorMessage
|
Text |
|
|
HelpArticleCode
|
Code[30] |
|
LogContextFieldError
procedure LogContextFieldError(ContextFieldNo: Integer; ErrorMessage: Text; SourceVariant: Variant; SourceFieldNo: Integer; HelpArticleCode: Code[30])
Parameters
| Name |
Type |
Description |
|
ContextFieldNo
|
Integer |
|
|
ErrorMessage
|
Text |
|
|
SourceVariant
|
Variant |
|
|
SourceFieldNo
|
Integer |
|
|
HelpArticleCode
|
Code[30] |
|
LogMessage
procedure LogMessage(NewMessageType: Option; ContextFieldNo: Integer; InformationMessage: Text; SourceVariant: Variant; SourceFieldNo: Integer; HelpArticleCode: Code[30]): Boolean
Parameters
| Name |
Type |
Description |
|
NewMessageType
|
Option |
|
|
ContextFieldNo
|
Integer |
|
|
InformationMessage
|
Text |
|
|
SourceVariant
|
Variant |
|
|
SourceFieldNo
|
Integer |
|
|
HelpArticleCode
|
Code[30] |
|
Returns
LogErrorMessage
procedure LogErrorMessage(ContextFieldNo: Integer; ErrorMessage: Text; SourceVariant: Variant; SourceFieldNo: Integer; HelpArticleCode: Code[30]): Boolean
Parameters
| Name |
Type |
Description |
|
ContextFieldNo
|
Integer |
|
|
ErrorMessage
|
Text |
|
|
SourceVariant
|
Variant |
|
|
SourceFieldNo
|
Integer |
|
|
HelpArticleCode
|
Code[30] |
|
Returns
LogSimpleErrorMessage
procedure LogSimpleErrorMessage(ErrorMessage: Text): Boolean
Parameters
| Name |
Type |
Description |
|
ErrorMessage
|
Text |
|
Returns
LogTestField
procedure LogTestField(SourceVariant: Variant; SourceFieldNo: Integer): Boolean
Parameters
| Name |
Type |
Description |
|
SourceVariant
|
Variant |
|
|
SourceFieldNo
|
Integer |
|
Returns
LogTestField
procedure LogTestField(SourceVariant: Variant; SourceFieldNo: Integer; ExpectedValue: Variant): Boolean
Parameters
| Name |
Type |
Description |
|
SourceVariant
|
Variant |
|
|
SourceFieldNo
|
Integer |
|
|
ExpectedValue
|
Variant |
|
Returns
LogFieldError
procedure LogFieldError(SourceVariant: Variant; SourceFieldNo: Integer; ErrorMessage: Text): Boolean
Parameters
| Name |
Type |
Description |
|
SourceVariant
|
Variant |
|
|
SourceFieldNo
|
Integer |
|
|
ErrorMessage
|
Text |
|
Returns
InsertTempLineErrorMessage
procedure InsertTempLineErrorMessage(var TempLineErrorMessage: Record "Error Message" temporary; RecordId: RecordId; TableNo: Integer; FieldNo: Integer; Description: Text; CallStack: Text)
Parameters
CollectErrors
procedure CollectErrors(var TempLineErrorMessage: Record "Error Message" temporary)
Parameters
LogLastError
FldRefHasValue
procedure FldRefHasValue(FldRef: FieldRef): Boolean
Parameters
| Name |
Type |
Description |
|
FldRef
|
FieldRef |
|
Returns
GetErrorsFromResultValues
procedure GetErrorsFromResultValues(Values: List of [Text]; var TempErrorMessage: Record "Error Message" temporary)
Parameters
AddSubContextToLastErrorMessage
procedure AddSubContextToLastErrorMessage(Tag: Text; VariantRec: Variant)
Parameters
| Name |
Type |
Description |
|
Tag
|
Text |
|
|
VariantRec
|
Variant |
|
ParseErrorText
procedure ParseErrorText(JSON: Text; var TempErrorMessage: Record "Error Message" temporary)
Parameters
ErrorMessage2JSON
procedure ErrorMessage2JSON(var ErrorMessage: Record "Error Message"): Text
Parameters
Returns
PackErrorMessagesToResults
procedure PackErrorMessagesToResults(var TempErrorMessage: Record "Error Message" temporary; var Results: Dictionary of [Text, Text])
Parameters
LogWarning
procedure LogWarning(ContextFieldNo: Integer; WarningMessage: Text; SourceVariant: Variant; SourceFieldNo: Integer; HelpArticleCode: Code[30]): Boolean
Parameters
| Name |
Type |
Description |
|
ContextFieldNo
|
Integer |
|
|
WarningMessage
|
Text |
|
|
SourceVariant
|
Variant |
|
|
SourceFieldNo
|
Integer |
|
|
HelpArticleCode
|
Code[30] |
|
Returns
LogWarning
procedure LogWarning(WarningMessage: Text): Boolean
Parameters
| Name |
Type |
Description |
|
WarningMessage
|
Text |
|
Returns
LogInformation
procedure LogInformation(ContextFieldNo: Integer; InformationMessage: Text; SourceVariant: Variant; SourceFieldNo: Integer; HelpArticleCode: Code[30]): Boolean
Parameters
| Name |
Type |
Description |
|
ContextFieldNo
|
Integer |
|
|
InformationMessage
|
Text |
|
|
SourceVariant
|
Variant |
|
|
SourceFieldNo
|
Integer |
|
|
HelpArticleCode
|
Code[30] |
|
Returns
LogInformation
procedure LogInformation(InformationMessage: Text): Boolean
Parameters
| Name |
Type |
Description |
|
InformationMessage
|
Text |
|
Returns
PopContext
procedure PopContext(var ErrorContextElement: Codeunit "Error Context Element"): Integer
Parameters
Returns
PushContext
procedure PushContext(var ErrorContextElement: Codeunit "Error Context Element"; ContextVariant: Variant; ContextFieldNo: Integer; AdditionalInfo: Text[250]): Integer
Parameters
Returns
GetLastContext
procedure GetLastContext(var ErrorMessage: Record "Error Message"): Boolean
Parameters
Returns
BuildActionableErrorInfo
procedure BuildActionableErrorInfo(ErrorTitle: Text; ErrorMessage: Text; RecId: RecordId; ActionMessage: Text; ActionCodeunuitId: Integer; ActionName: Text): ErrorInfo
Parameters
| Name |
Type |
Description |
|
ErrorTitle
|
Text |
|
|
ErrorMessage
|
Text |
|
|
RecId
|
RecordId |
|
|
ActionMessage
|
Text |
|
|
ActionCodeunuitId
|
Integer |
|
|
ActionName
|
Text |
|
Returns
| Type |
Description |
|
ErrorInfo |
|
BuildActionableErrorInfo
procedure BuildActionableErrorInfo(ErrorTitle: Text; ErrorMessage: Text; RecId: RecordId; ActionMessage: Text; ActionCodeunuitId: Integer; ActionName: Text; ActionDescription: Text): ErrorInfo
Parameters
| Name |
Type |
Description |
|
ErrorTitle
|
Text |
|
|
ErrorMessage
|
Text |
|
|
RecId
|
RecordId |
|
|
ActionMessage
|
Text |
|
|
ActionCodeunuitId
|
Integer |
|
|
ActionName
|
Text |
|
|
ActionDescription
|
Text |
|
Returns
| Type |
Description |
|
ErrorInfo |
|
BuildActionableErrorInfo
procedure BuildActionableErrorInfo(ErrorTitle: Text; ErrorMessage: Text; SysId: Guid; ActionMessage: Text; ActionCodeunuitId: Integer; ActionName: Text; ActionDescription: Text): ErrorInfo
Parameters
| Name |
Type |
Description |
|
ErrorTitle
|
Text |
|
|
ErrorMessage
|
Text |
|
|
SysId
|
Guid |
|
|
ActionMessage
|
Text |
|
|
ActionCodeunuitId
|
Integer |
|
|
ActionName
|
Text |
|
|
ActionDescription
|
Text |
|
Returns
| Type |
Description |
|
ErrorInfo |
|
GetTopContext
procedure GetTopContext(var ErrorMessage: Record "Error Message"): Boolean
Parameters
Returns
Events
OnFindActiveSubscriber
[IntegrationEvent(False,False)]
local procedure OnFindActiveSubscriber(var IsFound: Boolean)
Parameters
| Name |
Type |
Description |
|
IsFound
|
Boolean |
|
OnGetFirstContextID
[IntegrationEvent(False,False)]
local procedure OnGetFirstContextID(ContextRecordID: RecordId; var ContextID: Integer)
Parameters
| Name |
Type |
Description |
|
ContextRecordID
|
RecordId |
|
|
ContextID
|
Integer |
|
OnGetErrors
[IntegrationEvent(False,False)]
local procedure OnGetErrors(var TempErrorMessageResult: Record "Error Message" temporary)
Parameters
OnGetLastErrorID
[IntegrationEvent(False,False)]
local procedure OnGetLastErrorID(var ID: Integer; var ErrorMessage: Text[250])
Parameters
| Name |
Type |
Description |
|
ID
|
Integer |
|
|
ErrorMessage
|
Text[250] |
|
OnGetCachedLastErrorID
[IntegrationEvent(False,False)]
local procedure OnGetCachedLastErrorID(var ID: Integer)
Parameters
| Name |
Type |
Description |
|
ID
|
Integer |
|
OnLogSimpleError
[IntegrationEvent(False,False)]
local procedure OnLogSimpleError(ErrorMessage: Text; var IsLogged: Boolean)
Parameters
| Name |
Type |
Description |
|
ErrorMessage
|
Text |
|
|
IsLogged
|
Boolean |
|
OnLogError
[IntegrationEvent(False,False)]
local procedure OnLogError(MessageType: Option; ContextFieldNo: Integer; ErrorMessage: Text; SourceVariant: Variant; SourceFieldNo: Integer; HelpArticleCode: Code[30]; var IsLogged: Boolean)
Parameters
| Name |
Type |
Description |
|
MessageType
|
Option |
|
|
ContextFieldNo
|
Integer |
|
|
ErrorMessage
|
Text |
|
|
SourceVariant
|
Variant |
|
|
SourceFieldNo
|
Integer |
|
|
HelpArticleCode
|
Code[30] |
|
|
IsLogged
|
Boolean |
|
OnPushContext
[IntegrationEvent(False,False)]
local procedure OnPushContext()
OnGetTopElement
[IntegrationEvent(False,False)]
local procedure OnGetTopElement(var TopElementID: Integer)
Parameters
| Name |
Type |
Description |
|
TopElementID
|
Integer |
|
OnGetTopElementData
[IntegrationEvent(False,False)]
local procedure OnGetTopElementData(var TopElementID: Integer; var ContextRecID: RecordId; var ContextFldNo: Integer; var AdditionalInfo: Text[250])
Parameters
| Name |
Type |
Description |
|
TopElementID
|
Integer |
|
|
ContextRecID
|
RecordId |
|
|
ContextFldNo
|
Integer |
|
|
AdditionalInfo
|
Text[250] |
|
OnGetTopContext
[IntegrationEvent(False,False)]
local procedure OnGetTopContext(var ErrorMessage: Record "Error Message")
Parameters
OnLogLastError
[IntegrationEvent(False,False)]
local procedure OnLogLastError()
OnBeforeGetContextRecID
[IntegrationEvent(False,False)]
local procedure OnBeforeGetContextRecID(ContextVariant: Variant; var ContextRecID: RecordId; var IsHandled: Boolean)
Parameters
| Name |
Type |
Description |
|
ContextVariant
|
Variant |
|
|
ContextRecID
|
RecordId |
|
|
IsHandled
|
Boolean |
|
OnAddToJsonFromErrorMessage
[IntegrationEvent(False,False)]
local procedure OnAddToJsonFromErrorMessage(var JObject: JsonObject; var ErrorMessage: Record "Error Message" temporary)
Parameters
OnAddToErrorMessageFromJson
[IntegrationEvent(False,False)]
local procedure OnAddToErrorMessageFromJson(var ErrorMessage: Record "Error Message" temporary; var JObject: JsonObject)
Parameters
OnAddSubContextToLastErrorMessage
[IntegrationEvent(False,False)]
local procedure OnAddSubContextToLastErrorMessage(Tag: Text; VariantRec: Variant; var ErrorMessage: Record "Error Message" temporary)
Parameters
See also