CodeCop Warning AA0233
Use Get(), FindFirst() and FindLast() without Next() method.
Description
Avoid enumeration of a dataset when the dataset is not filtered.
Reason for the rule
If you use FindFirst()
, FindLast()
, or Get()
, then the database query will only fetch a single record and must fetch again when you call Next()
, which will lower performance.
Bad code example
codeunit 1 MyCodeunit
{
var
customer: Record Customer;
procedure Foo()
begin
...
customer.FindFirst();
...
customer.Next();
...
end;
}
Good code example
codeunit 1 MyCodeunit
{
var
customer : Record Customer;
procedure Foo()
begin
...
customer.FindFirst();
...
end;
}
See Also
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示