bcquality/microsoft/knowledge/performance/load-only-primary-key-fields-for-reference-work.good.al
Jesper Schulz-Wedde 78eeb86a37 Promote performance knowledge from community to Microsoft layer
Pure git-mv relocation of all 7 performance articles from community/knowledge/performance/ to microsoft/knowledge/performance/. No content changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-25 14:03:39 +02:00

17 lines
508 B
AL

codeunit 50100 "Item Reindex Queue"
{
procedure QueueItemsForReindex(CategoryCode: Code[20])
var
Item: Record Item;
ReindexQueue: Codeunit "Reindex Queue";
begin
// Only the primary key is used in the loop body; load nothing else.
Item.SetLoadFields("No.");
Item.SetRange("Item Category Code", CategoryCode);
if Item.FindSet() then
repeat
ReindexQueue.Enqueue(Item."No.");
until Item.Next() = 0;
end;
}