mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-06 07:06:54 +01:00
Second contribution from CURABIS ApS, generalized from patterns observed across real AppSource/PTE development. Cross-checked against the current microsoft/knowledge corpus before opening; several originally-drafted candidates were dropped as duplicates of existing files.
26 lines
797 B
AL
26 lines
797 B
AL
codeunit 50100 "Sample Error Log Writer"
|
|
{
|
|
// Started via Session.StartSession so its commit is independent of the
|
|
// caller's transaction. Does one thing: insert the log entry, commit.
|
|
trigger OnRun()
|
|
var
|
|
ErrorLogEntry: Record "Sample Error Log";
|
|
begin
|
|
ErrorLogEntry.Init();
|
|
ErrorLogEntry."Call Duration (ms)" := CallDurationMs;
|
|
ErrorLogEntry."Error Message" :=
|
|
CopyStr(ErrorMessageText, 1, MaxStrLen(ErrorLogEntry."Error Message"));
|
|
ErrorLogEntry.Insert(true);
|
|
Commit();
|
|
end;
|
|
|
|
procedure SetParameters(Duration: Integer; ErrorText: Text)
|
|
begin
|
|
CallDurationMs := Duration;
|
|
ErrorMessageText := ErrorText;
|
|
end;
|
|
|
|
var
|
|
CallDurationMs: Integer;
|
|
ErrorMessageText: Text;
|
|
}
|