Describe the bug
As with #5665 I am getting a number of these errors even after it has been reported as "fixed".
I get
The record AccountingPeriod2 should be modified before saving to the database.
With this code, this is just one of many examples.
local procedure GetPeriodEnd(PeriodStart: Date): Date;
var
AccountingPeriod2: Record "Accounting Period";
begin
with AccountingPeriod2 do begin
SetFilter("Starting Date", '>%1', PeriodStart);
if FindFirst() then begin
exit(CalcDate('<-1D>', "Starting Date"));
end else begin
exit(CalcDate('<+CM>', PeriodStart));
end;
end;
end;
A clear and concise description of what the bug is.
To Reproduce
Steps and to reproduce the behavior:
See below, just create the procedure shown
local procedure GetPeriodEnd(PeriodStart: Date): Date;
var
AccountingPeriod2: Record "Accounting Period";
begin
with AccountingPeriod2 do begin
SetFilter("Starting Date", '>%1', PeriodStart);
if FindFirst() then begin
exit(CalcDate('<-1D>', "Starting Date"));
end else begin
exit(CalcDate('<+CM>', PeriodStart));
end;
end;
end;
Expected behavior
No warning when a record is NOT updated
Screenshots
None
5. Versions:
MS, with the greatest respect: please consider just disabling this diagnostic until it actually works. The number of legitimate cases it could catch seems dwindling compared to the number of false positives people have had to wade through across the months.
Most helpful comment
MS, with the greatest respect: please consider just disabling this diagnostic until it actually works. The number of legitimate cases it could catch seems dwindling compared to the number of false positives people have had to wade through across the months.