BusinessCentral.LinterCop icon indicating copy to clipboard operation
BusinessCentral.LinterCop copied to clipboard

LC0016 on promoted action groups

Open jwikman opened this issue 3 weeks ago • 0 comments

Opposite to https://github.com/StefanMaron/BusinessCentral.LinterCop/issues/496, I believe that Captions should always be required on promoted action groups. Opposite to my own suggestion, https://github.com/StefanMaron/BusinessCentral.LinterCop/issues/587, I believe that Captions should be required even when not having ShowAs = SplitButton.

I just had a case where LC0016 did not behave as requested in #587, but instead of trying to figure out why - I believe that LC0016 should be updated to always require captions on promoted action groups, regardless of ShowAs or Scope.

The reason for above is the Tablet Client, that shows the auto-generated group captions in the menu, regardless of the ShowAs or Scope parameters.

The sample below shows the auto-generated group captions in tablet client (the repeater one shows up also in web client, as mentioned in #587)

Image

Image

page 50100 PageName
{
    Caption = 'PageCaption';
    Editable = false;
    PageType = List;
    ApplicationArea = All;
    UsageCategory = Lists;
    SourceTable = Customer;

    layout
    {
        area(Content)
        {
            repeater(GroupName)
            {
                field("No."; Rec."No.")
                {
                }
                field(Name; Rec.Name)
                {
                }
            }
        }
    }

    actions
    {
        area(Processing)
        {
            group(RegularGroup)
            {
                Caption = 'Regular Group Caption';
                action(PromotedActionName2)
                {
                    Caption = 'Action with Page Scope';
                    ApplicationArea = All;
                    Scope = Page;

                    trigger OnAction()
                    begin
                        Message('Hello World');
                    end;
                }
                action(ActionWithRepeaterScope)
                {
                    Caption = 'Action with Repeater Scope';
                    ApplicationArea = All;
                    Scope = Repeater;

                    trigger OnAction()
                    begin
                        Message('Hello World');
                    end;
                }
            }
        }
        area(Promoted)
        {
            group(Category_DEMO)
            {
                ShowAs = SplitButton;
                actionref(PromotedActionName2_Promoted; PromotedActionName2)
                {
                }
            }
            group(Category_Repeater)
            {
                ShowAs = SplitButton;
                actionref(ActionWithRepeaterScope_Promoted; ActionWithRepeaterScope)
                {
                }
            }
        }
    }
}

My apologies for the confusion with several issues and discussions...

jwikman avatar Feb 09 '25 00:02 jwikman