local procedure SimulateErrors()
var
RunProcess: Codeunit "EL Run Process";
HasError: Boolean;
i: Integer;
begin
for i := 1 to 30 do begin
ClearLastError();
RunProcess.SetParams(GetOneOrTwo());
HasError := not RunProcess.Run();
if HasError then
InsertErrorLog();
Commit();
end;
end;
codeunit 70300 "EL Run Process"
{
trigger OnRun()
begin
InsertRecord();
end;
procedure SetParams(RandomInt: Integer)
begin
gRandomInt := RandomInt;
end;
local procedure InsertRecord()
var
SimulateTransaction: Record "EL Simulate Transaction";
begin
SimulateTransaction.Init();
case gRandomInt of
1:
SimulateTransaction."Is Insert" := false;
2:
SimulateTransaction."Is Insert" := true;
end;
SimulateTransaction.Insert(true);
end;
var
gRandomInt: Integer;
}
trigger OnInsert()
begin
Rec.TestField("Is Insert");
end;