Skip to content
Merged
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 @@ -93,7 +93,6 @@ codeunit 4582 "SOA Retrieve Emails"
end;

AddEmailInboxToSOAEmails(SOASetup, EmailInbox);
UpdateSOAEarliestSyncAt(SOASetup, EmailInbox.Count());
Commit();

SOAEmail.SetRange(Processed, false);
Expand All @@ -116,17 +115,6 @@ codeunit 4582 "SOA Retrieve Emails"
Commit();
end;

local procedure UpdateSOAEarliestSyncAt(var SOASetup: Record "SOA Setup"; EmailsProcessed: Integer)
begin
SOASetup.Get(SOASetup.ID);
// Only move the earliest sync time forward if we processed fewer emails than the limit
// This ensures we'll re-query and get any we missed
if EmailsProcessed < SOAMailSetup.GetMaxNoOfEmails() then
SOASetup."Earliest Sync At" := CurrentDateTime();

SOASetup.Modify();
end;

local procedure AddEmailToAgentTask(SOASetup: Record "SOA Setup"; var SOAEmail: Record "SOA Email")
var
EmailInbox: Record "Email Inbox";
Expand Down
Loading