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
732 stars 243 forks source link

[Action Group Visibility] Dynamicaly set visibility doesn't show the action group #5378

Closed judecot closed 4 years ago

judecot commented 4 years ago

Describe the bug Hi,

Don't know if it's a bug or by design: I want to display a group of actions dynamically using the visible property of the group equals to a boolean variable.

All my actions has their default visibility (true). When I switch to true a boolean field on the page, I'm expecting that the action group is displayed but it's not. To do what I want, I have to set the visibility of all the actions of the group to my boolean value.

Note that with field groups it works as expected (see the code bellow).

To Reproduce

AL Code to reproduce the issue

page 50200 MyPage
{
    PageType = Card;
    ApplicationArea = All;
    UsageCategory = Administration;

    layout
    {
        area(Content)
        {
            group(GroupName)
            {
                field(myBool; _myBool)
                {
                    ApplicationArea = All;

                }
            }

            group(someothergrp)
            {
                Visible = _myBool;
                field(SomeVar; _someVar)
                {
                    ApplicationArea = All;
                }
            }
        }
    }

    actions
    {
        area(Processing)
        {
            group(ActionGrp)
            {
                Caption = 'My Actions';
                Visible = _myBool;
                action(ActionName)
                {
                    ApplicationArea = All;
                    Caption = 'MyAction';
                    trigger OnAction()
                    begin
                        Message('MyAction');
                    end;
                }

            }

        }
    }

    var
        [InDataSet]
        _myBool: Boolean;
        _someVar: Text;
}

Expected behavior A clear and concise description of what you expected to happen.

Screenshots

image

image

5. Versions:

AndreyKorepanov commented 4 years ago

Hi @JulienDecottignies, thank you for reporting the issue. It seems to be a bug, we'll take a look on it. Meanwhile a workaround for this issue is to add Visible = _myBool; to each action in the group, then hiding all the items in the group automatically hides enclosing group.

qutreson commented 4 years ago

We have reported this issue to the owning team which has added it to their backlog.

qutreson commented 4 years 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.

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.