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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Customize page actions to run without dialog boxes

(6) ShareShare
ReportReport
Posted on by 312
Hello, is there a way to customize page actions to run without dialog boxes?
 
For example, is there a way to run the standard page action for Create Pick on Warehouse Shipment to run without displaying the dialog box below?
 
Any suggestions, guidance, or AL code references would be greatly appreciated. Thank you!
 
I have the same question (0)
  • Suggested answer
    Teagen Boll Profile Picture
    3,334 Super User 2026 Season 1 on at
    How i've seen it done before is you replace the action with your own new button/action and hide the old button/action.
     
    Then use the new button/action to directly call a codeunit you've created that has all the options pre-defined.

    Would need a partner or developer to code that for you and then an end user to hide the old button.
     
    Best,
    Teagen Boll
    Social: LinkedIn
  • Suggested answer
    YUN ZHU Profile Picture
    102,389 Super User 2026 Season 1 on at
    This is a report; you can try the following method.
     
    Thanks.
    ZHU
  • Suggested answer
    Pallavi Phade Profile Picture
    5,742 Super User 2026 Season 1 on at
     
     
    Option 1
    You can call codeunit from page action and run the report passing the parameters . Without opening the dailog box . 
     
     
     
     
    *********************** Sample Example Codeunit****************
    var
        ReportParameters: Record ReportParameters;
        XmlParameters: Text;
        OStream: OutStream;
        IStream: InStream;
        CurrentUser: Code[100];
        Content: File;
        TempFileName: Text;
    begin
        // Use the Report.RunRequestPage method to run the request page to get report parameters  
        XmlParameters := Report.RunRequestPage(206);  
        CurrentUser := UserId;  
        
        // Save the request page parameters to the database table  
        with ReportParameters do begin  
            // Cleanup  
            if Get(206,CurrentUser) then  
            Delete;  
        
            SetAutoCalcFields(Parameters);  
            ReportId := 206;  
            UserId := CurrentUser;  
            Parameters.CreateOutStream(OStream,TextEncoding::UTF8);  
            Message(XmlParameters);  
            OStream.WriteText(XmlParameters);  
        
            Insert;  
        end;  
        
        Clear(ReportParameters);  
        XmlParameters := '';  
        
        // Read the request page parameters from the database table  
        with ReportParameters do begin  
            SetAutoCalcFields(Parameters);  
            Get(206,CurrentUser);  
            Parameters.CreateInStream(IStream,TextEncoding::UTF8);  
            IStream.ReadText(XmlParameters);  
        end;  
        
        // Use the Report.SaveAs method to save the report as a PDF file  
        Content.Create('TestFile.pdf');  // only supported in Business Central on-premises
        Content.CreateOutStream(OStream);  // only supported in Business Central on-premises
        Report.SaveAs(206,XmlParameters,ReportFormat::Pdf,OStream);  
        Content.Close;  // only supported in Business Central on-premises
        
        // Use the Report.Execute method to preview the report  
        Report.Execute(206,XmlParameters);  
        
        // Use the Report.Print method to print the report  
        Report.Print(206,XmlParameters);  
    end;
     
     
    *******************************
     
    Option 2 
     
    Report.Run() has 4 parameters . Set  Request window Property to False . Request page will not come and report will run directly .
     
    Report.Run(Number: Integer [, RequestWindow: Boolean] [, SystemPrinter: Boolean] [, var Record: Record])
     
     
     
    Warm Regards
    Pallavi Phade
    www.linkedin.com/in/pallaviphade131116
  • Suggested answer
    Assisted by AI
    Shrey Chauhan Profile Picture
    297 on at
    Hello,

    Yes — and your screenshot already told you exactly what you're fighting. Page Inspection shows the dialog is "Whse.-Shipment - Create Pick (7318, Report Request page)". So that box isn't a confirm dialog you can suppress with HideDialog; it's the request page of report 7318. The standard action on the Warehouse Shipment page ultimately calls that report (via CreatePickDoc on table 7320, which does Report.RunModal), and RunModal shows the request page by default.

    To run it headless you replicate that call yourself with UseRequestPage(false), and pre-set the options the request page would have collected via the report's Initialize procedure.

    A custom action that does it:

    pageextension 50100 "Whse. Shipment Ext" extends "Warehouse Shipment"
    {
        actions
        {
            // The base action's OnAction trigger can't be overridden in a pageextension,
            // so hide it and add your own.
            modify(CreatePick) { Visible = false; }
            addafter(CreatePick)
            {
                action(CreatePickNoDialog)
                {
                    Caption = 'Create Pick';
                    Image = CreateInventoryPickup;
                    ApplicationArea = Warehouse;
                    trigger OnAction()
                    var
                        WhseShptLine: Record "Warehouse Shipment Line";
                        CreatePick: Report "Whse.-Shipment - Create Pick";
                    begin
                        WhseShptLine.SetRange("No.", Rec."No.");
                        // Pre-set the options the request page would have asked for.
                        // Verify the exact signature against YOUR version's symbols (see note).
                        CreatePick.Initialize(
                            '',          // Assigned User ID
                            "Whse. Activity Sorting Method"::None,
                            false,       // Set Breakbulk Filter
                            true,        // Do Not Fill Qty. to Handle  (matches your screenshot)
                            false);      // Print Document
                        CreatePick.SetWhseShipmentLine(WhseShptLine, Rec);
                        CreatePick.UseRequestPage(false);   // <-- this is what kills the dialog
                        CreatePick.RunModal();
                    end;
                }
            }
        }
    }
     

    The mechanics:

    UseRequestPage(false) is the single line that suppresses the dialog. SetWhseShipmentLine is how the standard table code feeds the report (so you're using the same supported entry point, just without the UI). Initialize is how you set the options programmatically instead of having the user toggle them.

    The one thing to verify in your version: the Initialize signature. Across recent releases the request page gained extra toggles — your screenshot shows "Prioritize lines with item tracking" and "Show Summary (Directed Put-away...)" on top of the classic five, which means your Initialize may take more parameters than the example above (or those newer options may be set a different way). Right-click the report in VS Code → Go to Definition (or open it in the symbol browser) and check the actual procedure Initialize(...) parameters before wiring it up. If UseRequestPage(false) runs but an option you care about isn't set, it's almost always because that option isn't covered by your version's Initialize and defaults instead.

    Thanks.
    Shrey Chauhan
  • Suggested answer
    OussamaSabbouh Profile Picture
    18,239 Super User 2026 Season 1 on at
    Hello,
    yes, but you normally don’t “customize the standard action” directly; you add your own page extension action and run the same report/code behind it with the request page hidden. Since Create Pick on Warehouse Shipment is a report request page (Whse.-Shipment - Create Pick, report 7318), you can call it from AL using Report.RunModal(Report::"Whse.-Shipment - Create Pick", false, false, WhseShptHeader); where false skips the request page. The important point is that the report will then use default/previous parameters, so only do this if you are happy with fixed defaults, or build your own wrapper logic if you must control options like Assigned User ID, sorting, breakbulk, print, etc. 
    Regards,
    Oussama Sabbouh.
  • Pallavi Phade Profile Picture
    5,742 Super User 2026 Season 1 on at
     
    Hope my above answer helped , Please let me know in case of any queries 
     
     
     
    Warm Regards
    Pallavi Phade
    www.linkedin.com/in/pallaviphade131116
  • Suggested answer
    Grigorios Mavrogeorgis Profile Picture
    2,721 Super User 2026 Season 1 on at
    Hi,
    That dialog is the request page of report 7318 (Whse.-Shipment - Create Pick), not the action itself, so you skip it on the report run, not the action.
    The report has a public method SetWhseShipmentLine that take the Warehouse Shipment Line and the Header, so set your line(s) there first, not only the header, otherwise it does not know what to pick. Then turn the request page off with Report.UseRequestPage(false) before RunModal, and it run straight with no dialog. Just remember the user then can not set Assigned User ID, sorting, breakbulk and so on, so you fill those in code before.

    I would stay on the report public methods and any released events for this, not reach into the internal functions, because internals can break on upgrade while the public surface is more stable. So SetWhseShipmentLine plus UseRequestPage false is the cleaner path.
     
    Glad to help - follow up if anything is unclear.  
    ►  If this solved it, marking it verified helps others too.      
    Regards,
    Grigorios Mavrogeorgis
    Business Central Consultant & AL Developer

    Work: Gmsoft Limited
    Blog:  insidebusinesscentral
    LinkedIn: linkedin.com/in/gregorymavrogeorgis

     
  • Gerardo Rentería García Profile Picture
    27,507 Most Valuable Professional on at

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 653 Super User 2026 Season 1

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 414 Most Valuable Professional

#3
YUN ZHU Profile Picture

YUN ZHU 394 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans