web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

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

I have the same question (0)
  • Inge M. Bruvik Profile Picture
    1,111 Moderator on at

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

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

  • pscl Profile Picture
    5 on at

    unfortunately this also doesnt work.

  • Nitin Verma Profile Picture
    21,708 Moderator on at

    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

  • Suggested answer
    pscl Profile Picture
    5 on at

    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.

  • Verified answer
    Marco Mels Profile Picture
    on at

    Thank you for sharing final outcome. Great work.

  • Suggested answer
    Nitin Verma Profile Picture
    21,708 Moderator on at

    It will really help to others.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,092

#2
YUN ZHU Profile Picture

YUN ZHU 663 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 515

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans