AL
AL copied to clipboard
AA0072 CodeCop Rule - Incorrect warning with TestPage variables
1. Describe the bug In test scenarios, when I declare a TestPage variable, this warning is displayed, but with Record variables (for example) it works fine and it is not displayed
2. To Reproduce
- Setup CodeCops in
settings.jsonfile
{
"al.enableCodeAnalysis": true,
"al.codeAnalyzers": [
"${AppSourceCop}",
"${CodeCop}",
"${UICop}"
]
}
- Setup the app prefix in
appSourceCop.jsonfile
{
"mandatoryPrefix": "prfx_"
}
- Declare a TestPage variable in a [Test] procedure

codeunit 90000 "prfx_Test IRPF"
{
Subtype = Test;
[Test]
procedure SetupNewIRPFCodeWithANegativePercentageFromUI()
var
IRPF: Record "prfx_IRPF";
IRPFList: TestPage "prfx_IRPF List"; // compiler forces us to name it as "prfx_IRPFList" to be ok
begin
// do something here!
end;
}
3. Expected behavior This warning should not be shown with this type of variables used in TESTs.
4. Actual behavior The compiler forces us to add the prefix to the name of the variable of type TestPage
5. Versions:
- AL Language: v9.5.674382
- Visual Studio Code: 1.71.0
- Business Central: not related to a BC version
- List of Visual Studio Code extensions that you have installed: none