knowledge: improve review precision from BCApps PR 11063 feedback

This commit is contained in:
github-actions[bot] 2026-09-08 08:10:01 +00:00
parent 8584217c75
commit e74e2a6601
3 changed files with 85 additions and 0 deletions

View file

@ -0,0 +1,31 @@
codeunit 50251 "Perf Sample SyncWatermark Bad"
{
procedure RetrieveMonitoredFolderEmails(var MonitorSetup: Record "Email Monitor Setup")
var
TempFilters: Record "Email Retrieve Filters" temporary;
RetrievedCount: Integer;
begin
TempFilters."Earliest Email" := MonitorSetup."Earliest Sync At";
TempFilters."Exclude Processed Category" := true;
RetrievedCount := CallGraphRetrieve(TempFilters);
// Advancing the lower bound after every successful poll permanently
// excludes emails that are moved into the monitored folder later,
// because a moved email keeps its original (older) receivedDateTime.
if RetrievedCount < MaxBatchSize() then
MonitorSetup."Earliest Sync At" := CurrentDateTime;
MonitorSetup.Modify();
end;
local procedure MaxBatchSize(): Integer
begin
exit(50);
end;
local procedure CallGraphRetrieve(var TempFilters: Record "Email Retrieve Filters" temporary): Integer
begin
exit(0);
end;
}