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
722 stars 242 forks source link

Dropdown not validating selecting value when opening page from OnDrillDown #7668

Closed auzhhv closed 5 months ago

auzhhv commented 5 months ago

Please include the following with each issue:

1. Describe the bug I have a procedure that shows a page. The procedure is used from OnAction on a action and from OnDrillDown on a field. The page as a group before the repeater. The group has a field that is a variabel. The variabel has a tablerelation. When using the action to open the page, and using the dropdown menu to select a value, it works fine. The value is placed in the field and the OnValidate trigger for the field is ran. But when clicking the field (OnDrillDown) to open the page, I'm not able to select a value from the dropdown menu. I can see all the values and select one. But when I click it, it is not placed in the field, and the OnValidate is not ran. And I can manually enter a value into the field and it works. If I change the PageType from List to Worksheet it works as expected.

2. To Reproduce Steps to reproduce the behavior:

  1. Go to '...'

This works fine:

            action(ViewDetails)
            {
                Caption = 'View Details';
                Image = ViewDetails;
                ApplicationArea = All;
                ToolTip = 'View details about the selected line.';
                Scope = Repeater;

                trigger OnAction()
                begin
                    ShowDetails();
                end;
            }

This does not work as expected (field in the repeater):

                field("No. of Lines"; Rec."No. of Lines")
                {
                    ApplicationArea = All;
                    ToolTip = 'Specifies the number of production order, sales order and transfer order lines associated with the route.';
                    BlankZero = true;

                    trigger OnDrillDown()
                    begin
                        ShowDetails();
                    end;
                }

The procedure that runs the page:

    local procedure ShowDetails()
    var
        RoutingDetails: Page "AUZ Routing Details";
    begin
        RoutingDetails.Initialize(Rec, LocationFilter);
        RoutingDetails.Run();
    end;

This field is placed in a group before the repeater on the list page that is ran:

                field(DepartureCode; DepartureCode)
                {
                    Caption = 'Departure Code';
                    ApplicationArea = All;
                    TableRelation = "AUZ Departure";
                    ToolTip = 'Specifies the departure code for the shipment date and shipping agent.';
                    Editable = DepartureCodeEditable;

                    trigger OnValidate()
                    begin
                        SalesDepartureMgt.UpdateSalesLineDepartureCode(DepartureCode, GlobalRoutingBuffer."Shipment Date", GlobalShippingAgentCode);
                    end;
                }

Note: Because the developers need to copy and paste the code snippet, including a code snippet as a media file (i.e. .gif) is not sufficient.

3. Expected behavior I expect to be able to use de dropdown menu regardless of how the ShowDetailes procedure is ran.

4. Actual behavior When clicking on the value i expect it to be selected and placed into the field: image As so: image But when I click it, no value is selected, as so: image

5. Versions:

Final Checklist

Please remember to do the following:

SBalslev commented 5 months ago

Let's get the issue to a team who will fix and backport it, as this repository is only for issues related to the AL compiler in latest developer preview environment for Dynamics 365 Business Central. We suggest that you open a support case or file a bug in Collaborate, to ensure that all Business Central users benefit from your catch as soon as possible.

The suggestion is to try to use a worksheet page. If that doesn't work, create a support request.

To open a support case, you can:

If you file the bug in Collaborate, remember to include steps to reproduce the issue, and the Business Central build number and country version you're using.