Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,16 @@ codeunit 5261 "Audit File Export Mgt."
OnBeforeScheduleTask(DoNotScheduleTask, TaskID);
if DoNotScheduleTask then
AuditFileExportLine."Task ID" := TaskID
else
else begin
if not IsNullGuid(AuditFileExportLine."Task ID") then
if TaskScheduler.TaskExists(AuditFileExportLine."Task ID") then
TaskScheduler.CancelTask(AuditFileExportLine."Task ID");

AuditFileExportLine."Task ID" :=
TaskScheduler.CreateTask(
Codeunit::"Audit Line Export Runner", Codeunit::"Audit File Export Error Handl.", true, CompanyName(),
NotBefore, AuditFileExportLine.RecordId());
end;
AuditFileExportLine.Modify(true);
Commit();
NoOfJobs += 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ codeunit 5265 "Audit Line Export Runner"
FileContentInStream: InStream;
begin
Rec.LockTable();
Rec.Find();
if (Rec."Session ID" <> 0) and (Rec."Session ID" <> SessionId()) then
if Rec."Server Instance ID" = ServiceInstanceId() then
if Session.IsSessionActive(Rec."Session ID") then
exit;
Rec.Validate("Server Instance ID", ServiceInstanceId());
Rec.Validate("Session ID", SessionId());
Rec.Validate("Created Date/Time", 0DT);
Expand Down
Loading