bcquality/microsoft/knowledge/performance/prefer-modifyall-over-per-row-modify.good.al
Jesper Schulz-Wedde 0e06485027
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>
2026-07-14 11:26:29 +02:00

26 lines
643 B
AL

table 50242 "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 50242 "Perf Sample ModifyAll Good"
{
procedure MarkBatchProcessed(BatchId: Guid)
var
StagingEntry: Record "Perf Import Staging Entry";
begin
StagingEntry.SetRange("Batch ID", BatchId);
// Processed has no OnValidate logic, and the equivalent loop uses Modify(false).
StagingEntry.ModifyAll(Processed, true, false);
end;
}