mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-05 14:46:55 +01:00
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>
21 lines
634 B
AL
21 lines
634 B
AL
codeunit 50100 "Pass Var Enumerator Good"
|
|
{
|
|
procedure ListUsCustomerCities()
|
|
var
|
|
Customer: Record Customer;
|
|
begin
|
|
Customer.SetLoadFields(Name);
|
|
Customer.SetRange("Country/Region Code", 'US');
|
|
if Customer.FindSet() then
|
|
repeat
|
|
EnsureCityLoaded(Customer);
|
|
Message(Customer.Name + ' ' + Customer.City);
|
|
until Customer.Next() = 0;
|
|
end;
|
|
|
|
local procedure EnsureCityLoaded(var Customer: Record Customer)
|
|
begin
|
|
if not Customer.AreFieldsLoaded(Customer.City) then
|
|
Customer.LoadFields(Customer.City);
|
|
end;
|
|
}
|