microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
737 stars 243 forks source link

Error AL0255 - Property 'RunPageView' #7716

Closed MotivatedEmployee closed 5 months ago

MotivatedEmployee commented 5 months ago

1. Describe the bug

Even if actions have not been displayed on a report request page for several versions, it is still possible to program them. (It can also be included in historically grown solutions). With a "correctly" developed property 'RunPageView' in a request page on a report, the following message appears in AL version 13.x: Property 'RunPageView' requires an application object reference for the 'RunObject' property.AL (AL0255)

2. To Reproduce

  1. Create a report which contains a requestpage and an action with the properties RunObject and RunPageView.
  2. The property RunPageView is marked with the following error: "Property 'RunPageView' requires an application object reference for the 'RunObject' property.AL (AL0255)"
report 50100 "Test Report"
{
    Caption = 'Test Report';
    UsageCategory = ReportsAndAnalysis;
    ApplicationArea = All;

    dataset
    {
        dataitem(DataItemName; Contact)
        {
            column(ColumnName; DataItemName.Name)
            {

            }
        }
    }

    requestpage
    {
        layout
        {
            area(Content)
            {
                group(GroupName)
                {
                    field(Name; myInt)
                    {
                        ApplicationArea = All;
                    }
                }
            }
        }

        actions
        {
            area(processing)
            {
                action(ActionName)
                {
                    ApplicationArea = All;
                    RunObject = page "Contact List";
                    RunPageView = where("No." = const('CON0001'));
                }
            }
        }
    }

    var
        myInt: Integer;
}

3. Expected behavior Be able to compile with an action with the properties RunObject and RunPageView in a report - requestpage.

4. Actual behavior Can not compile with an action with the properties RunObject and RunPageView in a report - requestpage.

5. Versions: AL Language: v13.0.971907 Visual Studio Code: 1.88.0 (user setup) Business Central: 23.5.16502 / 24.0.16410

thloke commented 5 months ago

This is unfortunate because AFAIK (though some NAV veteran might know otherwise) actions have never been actually supported on request pages so we should have blocked them out of the gate when we introduced request pages. Since we cannot now remove them without breaking a lot of things, they're available in AL but they just don't do anything.

This also means we don't want to do any work to support them better in syntax, since the ideal long term goal would be to remove them altogether. So while this is a bug, I don't think it's one that we want to fix.