Codeunit 31 Last Error Context Element

App
Base Application
Namespace
System.Utilities
Versions
19-28

Procedures, 3

Versions171819202122232425262728

Source29

Source in 29

src/Layers/W1/BaseApp/Modules/System/ErrorMessage/LastErrorContextElement.Codeunit.al26 lines, Copyright (c) Microsoft Corporation. MIT

namespace System.Utilities;

codeunit 31 "Last Error Context Element"
{
    SingleInstance = true;

    var
        LastErrorContextElement: Codeunit "Error Context Element";

    procedure Set(var ErrorContextElement: Codeunit "Error Context Element")
    begin
        LastErrorContextElement.Copy(ErrorContextElement);
    end;

    procedure Set(ID: Integer; ContextRecID: RecordID; ContextFldNo: Integer; AdditionalInfo: Text[250])
    begin
        LastErrorContextElement.Set(ID, ContextRecID, ContextFldNo, AdditionalInfo);
    end;

    procedure GetErrorMessage(var ErrorMessage: Record "Error Message")
    begin
        ErrorMessage.Init();
        LastErrorContextElement.GetErrorMessage(ErrorMessage);
        ErrorMessage.Context := false;
    end;
}