bcquality/microsoft/knowledge/performance/use-get-instead-of-findfirst-on-full-primary-key.bad.al
Stefano Demiliani ac249ba4c9
Some checks failed
Validate knowledge index / validate-index (push) Has been cancelled
Validate AL review fixtures / validate-review-fixtures (push) Has been cancelled
Validate skill index and report schemas / validate-contract (push) Has been cancelled
Validate frontmatter and structure / validate (push) Has been cancelled
Preserve business filters when recommending Record.Get (#205)
2026-10-02 13:07:19 +02:00

20 lines
524 B
AL

codeunit 50211 "Perf Sample GetByPK Bad"
{
procedure ShowName(CustomerNo: Code[20])
var
Customer: Record Customer;
begin
Customer.SetRange("No.", CustomerNo);
if Customer.FindFirst() then
Message(Customer.Name);
end;
procedure ShowUnblockedName(CustomerNo: Code[20])
var
Customer: Record Customer;
begin
Customer.SetRange(Blocked, Customer.Blocked::" ");
if Customer.Get(CustomerNo) then
Message(Customer.Name);
end;
}