AL icon indicating copy to clipboard operation
AL copied to clipboard

AA0198 is not reported for variables inside the triggers of report data items

Open dannoe opened this issue 2 years ago • 0 comments

1. Describe the bug The AA0198 warning is not issued for local variables that have the same name as global variables if the local variables are within the trigger of a report data item.

2. To Reproduce see Code

report 50000 "ABC Test"
{
    dataset
    {

        dataitem("User Setup"; "User Setup")
        {
            trigger OnAfterGetRecord()
            var
                SalesLine: Record "Sales Line"; // expecting AA0198
            begin
                Message(Format(SalesLine.Count()));
            end;
        }

    }

    trigger OnPreReport()
    begin
        Message(Format(SalesLine.Count()));
    end;

    var
        SalesLine: Record "Sales Line";
}


3. Expected behavior Should warn with AA0198

4. Actual behavior Doesn't warn

5. Versions:

Name: AL Language extension for Microsoft Dynamics 365 Business Central Id: ms-dynamics-smb.al Description: Development tools for Dynamics 365 Business Central Version: 11.5.834620 Publisher: Microsoft

dannoe avatar Aug 29 '23 15:08 dannoe