Correct performance knowledge guidance (#94)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 667c64a8-eb36-4440-bc41-6a97d8fb5542

Co-authored-by: Jesper Schulz-Wedde <jesper.schulzwedde@microsoft.com>
This commit is contained in:
Jesper Schulz-Wedde 2026-07-14 11:26:29 +02:00 committed by GitHub
parent 5706959e4a
commit 0e06485027
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 279 additions and 261 deletions

View file

@ -1,15 +1,29 @@
table 50243 "Perf Import Staging Entry"
{
fields
{
field(1; "Entry No."; Integer) { }
field(2; "Batch ID"; Guid) { }
field(3; Processed; Boolean) { }
}
keys
{
key(PK; "Entry No.") { Clustered = true; }
}
}
codeunit 50243 "Perf Sample ModifyAll Bad"
{
procedure ApplyPriceUpdate(NewPrice: Decimal)
procedure MarkBatchProcessed(BatchId: Guid)
var
SalesLine: Record "Sales Line";
StagingEntry: Record "Perf Import Staging Entry";
begin
SalesLine.SetRange(Type, SalesLine.Type::Item);
// N writes when one ModifyAll would do.
if SalesLine.FindSet() then
StagingEntry.SetRange("Batch ID", BatchId);
if StagingEntry.FindSet(true) then
repeat
SalesLine.Validate("Unit Price", NewPrice);
SalesLine.Modify(true);
until SalesLine.Next() = 0;
StagingEntry.Processed := true;
StagingEntry.Modify(false);
until StagingEntry.Next() = 0;
end;
}