CodeCop Warning AA0244
Do not use identical names for parameters and global variables.
Description
Do not use identical names for parameters and global variables.
Remarks
This CodeCop rule is similar to AA0198, but it applies to method parameters. The rule warns when a method's parameters names collide with global variable names, but with the following specifics for Event declaration.
AA0244 doesn't warn on Events with the exception of Integration Events that have GlobalVarAccess set to true
.
No warning
codeunit 50100 MyCodeunit
{
// GlobalVarAccess = false hence we don't warn
[IntegrationEvent(true, false)]
local procedure MyNewEvent(EventParamA: Integer)
begin
end;
}
Warning
codeunit 50100 MyCodeunit
{
// GlobalVarAccess = true hence we warn
[IntegrationEvent(true, true)]
local procedure MyNewEvent(EventParamA: Integer)
begin
end;
}
Note
Rule AA0244 warns on EventSubscribers and even if the subscribers don't have control over the names of the parameters, they have control over the global variables living in the Codeunit.
See Also
CodeCop Analyzer
Getting Started with AL
Developing Extensions
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기