DavidFeldhoff / al-codeactions

MIT License
17 stars 8 forks source link

[Bug] "Promote Action" does not add actionRef #156

Closed fvet closed 1 year ago

fvet commented 1 year ago

@DavidFeldhoff Can you please verify why below action cannot be promoted with the new 'Promote Action' code action?

pageextension 71097237 "ESCQ Item List" extends "Item List" // 31
{
    actions
    {
        addafter(SalesPriceListsDiscounts)
        {
            action("ESCQ Sales Promotions")
            {
                AccessByPermission = TableData "ESCQ Sales Promotion" = R;
                ApplicationArea = All;
                Caption = 'Sales Promotions';
                Image = Discount; // NewItem
                Scope = Repeater;
                ToolTip = 'Set up sales promotions for the item. A sales promotion is automatically granted on sales lines when the specified criteria are met, such as customer, quantity, or ending date.';
                RunObject = page "ESCQ Sales Promotions";
                RunPageLink = "No." = field("No.");
            }
        }
    }
}

PromoteAction2

DavidFeldhoff commented 1 year ago

Hm.. It's definitely because of the page extension. But I just found out that Microsofts code actions are also not working if there's no promoted action area so far on the base page. In your specific case, the Item List page it could work by adding an addfirst to that already existing promoted action area, so that's what I could fix. image

But if that promoted-area is not there on the base page, then it's currently not possible in a page extension to promote something via actionref right? Or am I missing something @fvet ?

DavidFeldhoff commented 1 year ago

That it wasn't working seems to be fixed in the latest AL Language extension version. At least I couldn't reproduce it anymore. Anyhow, I could now get it managed to support promoting actions for page extensions as well. It's shipped in v1.0.28