bcquality/community/knowledge/performance/countapprox-for-progress-not-count.good.al
Stefano Demiliani ebceff2332 knowledge(performance): add community rules for JIT, locks, and false positives
These articles capture BC-specific mechanics agents still invert: partial-record JIT on writes, Reset clearing SetLoadFields, HttpClient inside write transactions, and batched number series, plus negative guidance that stops over-eager Query and IsEmpty "fixes".

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-20 15:57:58 +02:00

21 lines
605 B
AL

codeunit 50100 "CountApprox Progress Good"
{
procedure RecalcUsCustomers()
var
Customer: Record Customer;
Window: Dialog;
Counter: Integer;
Total: Integer;
begin
Customer.SetRange("Country/Region Code", 'US');
Total := Customer.CountApprox();
Window.Open('Processing #1###### of #2######');
if Customer.FindSet(true) then
repeat
Counter += 1;
Window.Update(1, Counter);
Window.Update(2, Total);
until Customer.Next() = 0;
Window.Close();
end;
}