Share via


Codeunit "Error Message Management"

ID 28
Namespace: System.Utilities

Methods

Activate

procedure Activate(var ErrorMessageHandler: Codeunit "Error Message Handler"): Boolean

Parameters

Name Type Description
ErrorMessageHandler Codeunit System.Utilities."Error Message Handler"

Returns

Type Description
Boolean

Activate

procedure Activate(var ErrorMessageHandler: Codeunit "Error Message Handler", ClearError: Boolean): Boolean

Parameters

Name Type Description
ErrorMessageHandler Codeunit System.Utilities."Error Message Handler"
ClearError Boolean

Returns

Type Description
Boolean

IsActive

procedure IsActive(): Boolean

Returns

Type Description
Boolean

Finish

procedure Finish(ContextVariant: Variant)

Parameters

Name Type Description
ContextVariant Variant

FinishTopContext

procedure FinishTopContext()

IsTransactionStopped

procedure IsTransactionStopped(): Boolean

Returns

Type Description
Boolean

GetCurrCallStack

procedure GetCurrCallStack(): Text

Returns

Type Description
Text

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

Type Description
Integer

FindFirstErrorMessage

procedure FindFirstErrorMessage(var ErrorMessage: Text[250]): Boolean

Parameters

Name Type Description
ErrorMessage Text[250]

Returns

Type Description
Boolean

GetErrors

procedure GetErrors(var TempErrorMessage: Record "Error Message" temporary): Boolean

Parameters

Name Type Description
TempErrorMessage Table System.Utilities."Error Message"

Returns

Type Description
Boolean

GetErrorsInContext

procedure GetErrorsInContext(ContextVariant: Variant, var TempErrorMessage: Record "Error Message" temporary): Boolean

Parameters

Name Type Description
ContextVariant Variant
TempErrorMessage Table System.Utilities."Error Message"

Returns

Type Description
Boolean

GetLastError

procedure GetLastError(var ErrorMessage: Text[250]): Integer

Parameters

Name Type Description
ErrorMessage Text[250]

Returns

Type Description
Integer

GetLastErrorID

procedure GetLastErrorID(): Integer

Returns

Type Description
Integer

GetCachedLastErrorID

procedure GetCachedLastErrorID(): Integer

Returns

Type Description
Integer

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

Type Description
Boolean

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

Type Description
Boolean

LogSimpleErrorMessage

procedure LogSimpleErrorMessage(ErrorMessage: Text): Boolean

Parameters

Name Type Description
ErrorMessage Text

Returns

Type Description
Boolean

LogTestField

procedure LogTestField(SourceVariant: Variant, SourceFieldNo: Integer): Boolean

Parameters

Name Type Description
SourceVariant Variant
SourceFieldNo Integer

Returns

Type Description
Boolean

LogTestField

procedure LogTestField(SourceVariant: Variant, SourceFieldNo: Integer, ExpectedValue: Variant): Boolean

Parameters

Name Type Description
SourceVariant Variant
SourceFieldNo Integer
ExpectedValue Variant

Returns

Type Description
Boolean

LogFieldError

procedure LogFieldError(SourceVariant: Variant, SourceFieldNo: Integer, ErrorMessage: Text): Boolean

Parameters

Name Type Description
SourceVariant Variant
SourceFieldNo Integer
ErrorMessage Text

Returns

Type Description
Boolean

InsertTempLineErrorMessage

procedure InsertTempLineErrorMessage(var TempLineErrorMessage: Record "Error Message" temporary, RecordId: RecordId, TableNo: Integer, FieldNo: Integer, Description: Text, CallStack: Text)

Parameters

Name Type Description
TempLineErrorMessage Table System.Utilities."Error Message"
RecordId RecordId
TableNo Integer
FieldNo Integer
Description Text
CallStack Text

CollectErrors

procedure CollectErrors(var TempLineErrorMessage: Record "Error Message" temporary)

Parameters

Name Type Description
TempLineErrorMessage Table System.Utilities."Error Message"

LogLastError

procedure LogLastError()

FldRefHasValue

procedure FldRefHasValue(FldRef: FieldRef): Boolean

Parameters

Name Type Description
FldRef FieldRef

Returns

Type Description
Boolean

GetErrorsFromResultValues

procedure GetErrorsFromResultValues(Values: List of [Text], var TempErrorMessage: Record "Error Message" temporary)

Parameters

Name Type Description
Values List of [Text]
TempErrorMessage Table System.Utilities."Error Message"

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

Name Type Description
JSON Text
TempErrorMessage Table System.Utilities."Error Message"

ErrorMessage2JSON

procedure ErrorMessage2JSON(var ErrorMessage: Record "Error Message"): Text

Parameters

Name Type Description
ErrorMessage Table System.Utilities."Error Message"

Returns

Type Description
Text

PackErrorMessagesToResults

procedure PackErrorMessagesToResults(var TempErrorMessage: Record "Error Message" temporary, var Results: Dictionary of [Text, Text])

Parameters

Name Type Description
TempErrorMessage Table System.Utilities."Error Message"
Results Dictionary of [Text, Text]

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

Type Description
Boolean

LogWarning

procedure LogWarning(WarningMessage: Text): Boolean

Parameters

Name Type Description
WarningMessage Text

Returns

Type Description
Boolean

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

Type Description
Boolean

LogInformation

procedure LogInformation(InformationMessage: Text): Boolean

Parameters

Name Type Description
InformationMessage Text

Returns

Type Description
Boolean

PopContext

procedure PopContext(var ErrorContextElement: Codeunit "Error Context Element"): Integer

Parameters

Name Type Description
ErrorContextElement Codeunit System.Utilities."Error Context Element"

Returns

Type Description
Integer

PushContext

procedure PushContext(var ErrorContextElement: Codeunit "Error Context Element", ContextVariant: Variant, ContextFieldNo: Integer, AdditionalInfo: Text[250]): Integer

Parameters

Name Type Description
ErrorContextElement Codeunit System.Utilities."Error Context Element"
ContextVariant Variant
ContextFieldNo Integer
AdditionalInfo Text[250]

Returns

Type Description
Integer

GetLastContext

procedure GetLastContext(var ErrorMessage: Record "Error Message"): Boolean

Parameters

Name Type Description
ErrorMessage Table System.Utilities."Error Message"

Returns

Type Description
Boolean

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

Name Type Description
ErrorMessage Table System.Utilities."Error Message"

Returns

Type Description
Boolean

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

Name Type Description
TempErrorMessageResult Table System.Utilities."Error Message"

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

Name Type Description
ErrorMessage Table System.Utilities."Error Message"

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

Name Type Description
JObject JsonObject
ErrorMessage Table System.Utilities."Error Message"

OnAddToErrorMessageFromJson

[IntegrationEvent(False,False)]
local procedure OnAddToErrorMessageFromJson(var ErrorMessage: Record "Error Message" temporary, var JObject: JsonObject)

Parameters

Name Type Description
ErrorMessage Table System.Utilities."Error Message"
JObject JsonObject

OnAddSubContextToLastErrorMessage

[IntegrationEvent(False,False)]
local procedure OnAddSubContextToLastErrorMessage(Tag: Text, VariantRec: Variant, var ErrorMessage: Record "Error Message" temporary)

Parameters

Name Type Description
Tag Text
VariantRec Variant
ErrorMessage Table System.Utilities."Error Message"

See also