CodeCop : AA0008 warning allows use and execution of OnPrem functions in BC sandbox
Describe the bug Warnings raised by compiler rule AA0008 can hide errors, allowing an app to compile that should not normally compile.
To Reproduce Steps and to reproduce the behavior:
- Start a new project, set target Extension, turn on CodeCop
- Create page based on T36 Sales Header
- Add any trigger/function.
- In code call CheckItemAvailabilityInLines;
- AA0008 reports warning "You must specify open and close parenthesis..."
- Add parentheses
- Warning transforms to error AL0296 - function is marked as internal in T36
page 50000 Test
{
PageType = Card;
ApplicationArea = All;
UsageCategory = Administration;
SourceTable = "Sales Header";
trigger OnAfterGetCurrRecord()
begin
CheckItemAvailabilityInLines;
end;
}
page 50000 Test
{
PageType = Card;
ApplicationArea = All;
UsageCategory = Administration;
SourceTable = "Sales Header";
trigger OnAfterGetCurrRecord()
begin
CheckItemAvailabilityInLines();
end;
}
Expected behavior I expect errors to be raised as higher priority than warnings, warnings should never overrule the errors.
Versions:
- AL Language: 3.0.145991
- Business Central: Microsoft_Application_14.1.33107.0 ; Microsoft_System_14.0.32600.33003
Hi @JuricaB ! We will investigate this as soon as possible.
In the last months, we have been hard at work on the next release of the developer tools. You can read Freddy's blog post to find out more https://freddysblog.com/2019/07/31/preview-of-dynamics-365-business-central-2019-release-wave-2/ . Let us know what you think and especially if you still encounter this issue.
HI @atoader,
This is still an issue with Wave 2 - replicated on 4.0.182565.
Furthermore, the error is somewhat worse than I thought, as it also allows you to use functions marked as OnPrem in bc sandbox docker.
See below, screenshots taken on new 15.0 docker:

EDIT: Just realized AA0008 is no longer showing (on 4.0.182565) for this example at all.
Hi @JuricaB, thank you for reporting this issue. This appears to be a duplicate of #5191. Feel free to contribute on the related issue.