CodeCop Warning AA0181
The FindSet() or Find() methods must be used only in connection with the Next() method.
Description
Avoid getting the dataset when an enumeration is not used, which will decrease performance.
Reason for the rule
If you use FindSet()
or Find()
you must have a Next()
method. Otherwise, you are wasting CPU and bandwidth since multiple records are loaded but you only use one.
Bad code example
codeunit 1 MyCodeunit
{
var
customer: Record Customer;
procedure Foo()
begin
if customer.FindFirst() then
repeat
...
until customer.Next() = 0;
end;
}
Good code example
codeunit 1 MyCodeunit
{
var
customer : Record Customer;
procedure Foo()
begin
if customer.FindSet() then
repeat
...
until customer.Next() = 0;
end;
}
See Also
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示