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,17 @@
codeunit 50253 "Perf Sample NPlus1 Bad"
{
procedure SumStdCost(var BOMLine: Record "BOM Component") TotalCost: Decimal
procedure SumStdCost(BOMNo: Code[20]; BOMVersionCode: Code[20]) TotalCost: Decimal
var
BOMLine: Record "Production BOM Line";
Item: Record Item;
begin
BOMLine.SetRange("Production BOM No.", BOMNo);
BOMLine.SetRange("Version Code", BOMVersionCode);
if BOMLine.FindSet() then
repeat
// Full-row Item.Get per BOM line no partial loading, no caching.
Item.Get(BOMLine."No.");
if Item."Costing Method" = Item."Costing Method"::Standard then
TotalCost += Item."Standard Cost" * BOMLine."Quantity per";
if Item.Get(BOMLine."No.") then
if Item."Costing Method" = Item."Costing Method"::Standard then
TotalCost += Item."Standard Cost" * BOMLine."Quantity per";
until BOMLine.Next() = 0;
end;
}