Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Adding actions to the actionbar on a Listplustype page

(0) ShareShare
ReportReport
Posted on by 5

Hello, 

My excusses if this isnt on the right forum.

Let me get straight to the point. 

I have an action on a listplus page that sits in area processing in a group called functions

   actions
    {


        area(Processing)
        {

            group("F&unctions")
            {

                action("Transfer to Selected Table")
                {
                    ApplicationArea = Basic, Suite;
                    Caption = 'Transfer to selected table';
                    Ellipsis = true;
                    Image = TransferToGeneralJournal;
                    Promoted = true;
                    PromotedCategory = Category4;
                    PromotedIsBig = true;
                    ToolTip = 'Transfer the lines from the current window to the selected window.';
                
                    trigger OnAction()
                    var
                        availablePage: Page "OPL AvailableOrdersForTour";
                        available: Record "OPL PreTourSelection";
                        selected: record "OPL TransportTourSelected";
                    begin

                        CurrPage.AvailableOrders.Page.GetSelection(available);
                        if available.FindSet() then begin
                            repeat
                                selected.Init();
                                selected."Entry No." := available."Entry No.";
                                selected."Destination Adress" := available."Destination Adress";
                                selected."Document Type" := available."Document Type";
                                selected.FromAdress := available.FromAdress;
                                selected."Location Code" := available."Location Code";
                                selected."Source Document Type" := available."Source Document Type";
                                selected.Volume := available.Volume;
                                selected.Weight := available.Weight;
                                selected.VolumeUoM := available.VolumeUoM;
                                selected.WeightUom := available.WeightUom;
                                selected.Insert();
                            until available.Next() = 0;
                        end;
                        CalculateTotals();
                        available.DeleteAll(rec.MarkedOnly);
                        Commit();

                    end;
                }

                action(Create)
                {
                    ApplicationArea = Basic, Suite;
                    Caption = 'Create Trip';
                    Ellipsis = true;
                    Image = Create;
                    Promoted = true;
                    PromotedCategory = Category4;
                    PromotedIsBig = true;
                    ToolTip = 'Create a trip based on the selected orders';

                    trigger OnAction()
                    var
                        SelectedTable: Record "OPL TransportTourSelected";
                        TransportTourOrder: Record "OPL TransportTourOrder";
                        TransportTour: Record "OPL TransportTour";
                        TransportOrder: Record "OPL TransportOrder";
                        LoadRecord: Record "OPL TransportLoad";
                        TransportSourceDocType: enum "OPL TransportSourceDocType";

                        creatingTourFailedMsg: Label 'Creating Trip Failed';
                        NoOrderSelectedMsg: label 'You must select an order to create a trip.';
                    begin
                        if SelectedTable.FindSet() then begin

                        end
                        else begin
                            Message(NoOrderSelectedMsg);
                            exit;
                        end;
                        CreatedTourId := Rec."No.";
                        if SelectedTable.FindSet() then
                            repeat

                                TransportTourOrder.Init();
                                TransportTourOrder."Line No."  = 10000;
                                TransportTourOrder."No." := CreatedTourId;
                                TransportTourOrder."Order No." := SelectedTable."Entry No.";
                                TransportTourOrder."Location Code" := SelectedTable."Location Code";
                                TransportTourOrder.TransportAdress := SelectedTable.FromAdress;
                                TransportTourOrder.TransportToAdress := SelectedTable."Destination Adress";
                                TransportTourOrder."Document Type" := SelectedTable."Document Type";
                                TransportTourOrder.Volume := SelectedTable.Volume;
                                TransportTourOrder.Weight := SelectedTable.Weight;
                                TransportTourOrder.SourceDocType := SelectedTable."Source Document Type";
                                TransportTourOrder.Insert(true);

                                if (SelectedTable."Source Document Type" = TransportSourceDocType::TransportOrder) then begin

                                    TransportOrder.SetFilter(TransportOrder."No.", SelectedTable."Entry No.");
                                    if TransportOrder.FindSet() then begin
                                        TransportOrder.TourId := CreatedTourId;
                                        TransportOrder.Modify();
                                    end;
                                end else
                                    if SelectedTable."Source Document Type" = TransportSourceDocType::Load then begin

                                        LoadRecord.SetFilter(LoadRecord."No.", SelectedTable."Entry No.");
                                        if LoadRecord.FindSet() then begin
                                            LoadRecord.TourNo := CreatedTourId;
                                            LoadRecord.Modify();
                                        end;
                                    end;

                                Commit();

                            until SelectedTable.Next() = 0;
                        //If the transporttourorder is created go to the transportOrderTourCreation page                      

                        PAGE.Run(PAGE::"OPL TransportOrderTourCreation");

                    end;
                }
                action(ReCalculate)
                {
                    ApplicationArea = Basic, Suite;
                    Caption = 'Recalculate Trip';
                    Ellipsis = true;
                    Image = Create;
                    Promoted = true;
                    PromotedCategory = Category4;
                    PromotedIsBig = true;
                    ToolTip = 'Recalculates the Trip based on the selected orders';

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

            }
        }
    }

I can promote the group and all, but what i want to do is put the individual actions also onto the actionbar

pastedimage1662477112855v1.png

As shown in the image above i want to put Create Trip and Recalculate Trip next to actions.

Thank you in advance.

Pascal Engelen

  • Suggested answer
    Nitin Verma Profile Picture
    21,565 Moderator on at
    RE: Adding actions to the actionbar on a Listplustype page

    It will really help to others.

  • Verified answer
    Marco Mels Profile Picture
    on at
    RE: Adding actions to the actionbar on a Listplustype page

    Thank you for sharing final outcome. Great work.

  • Suggested answer
    pscl Profile Picture
    5 on at
    RE: Adding actions to the actionbar on a Listplustype page

    Hello,

    So i found out how i could place the button/action on the promoted bar.

    The problem was the action itself was sitting in a group, and you could only promote the group.

    By placing the action outside of the group and giving it its own category i was able to place the button in the actionbar.

    Thank you all for trying to help me.

  • Nitin Verma Profile Picture
    21,565 Moderator on at
    RE: Adding actions to the actionbar on a Listplustype page

    Hi,

    I think you can put anything after Actions or Related, either we can put out button inside Actions and Related menus. not the button itself be added next to Action or Related menu

    docs.microsoft.com/.../devenv-adding-actions-to-a-page

    pastedimage1662538532957v1.png

  • pscl Profile Picture
    5 on at
    RE: Adding actions to the actionbar on a Listplustype page

    unfortunately this also doesnt work.

  • Inge M. Bruvik Profile Picture
    1,029 Moderator on at
    RE: Adding actions to the actionbar on a Listplustype page

    You can try the Promoted Only and see if that makes a difference.

    docs.microsoft.com/.../devenv-promotedonly-property

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 1,452

#2
YUN ZHU Profile Picture

YUN ZHU 1,313 Super User 2025 Season 1

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 1,083 Most Valuable Professional

Featured topics

Product updates

Dynamics 365 release plans