How to Add a Custom Ribbon Button to the Global Command Bar in Dynamics 365 CRM

 The Global Command Bar is the toolbar at the top of every screen in your model-driven apps. This guide shows exactly how to add your own custom button to it using Ribbon Workbench.

What we will build: A “Create Case” button that opens a new Case form in a new browser tab — available everywhere in the app.

Prerequisites

  • Access to make.powerapps.com with solution customization rights.
  • Ribbon Workbench (install via XrmToolBox if you don’t have it).

Step-by-Step Instructions

  1. Create or open a solution in the Power Apps maker portal.
  2. Add the Application Ribbon:
    Click Add existing > More > Other > Application Ribbon.
    Add it and click Publish all customizations.
  3. Open Ribbon Workbench and load your solution.
  4. Locate the Global Tab: Go to Home tab > Mscrm.GlobalTab.
  5. Add the button: In the Toolbox (bottom left), drag a Button onto the command bar area under Mscrm.GlobalTab.
  6. Select the button and set Label = “Create Case” (add an icon if you want).
  7. Create a Command:
    In the right pane (Solution Elements), click the + icon to create a new Command.
    Then add a JavaScript action to this command.
  8. Create the JavaScript Web Resource:
    In your solution, click New > Web resource > Type: Script (JScript).

    /**
    * openNewCaseForm
    * ----------------
    * Opens a new Case record form in a new browser tab/window from the global command bar button.
    *
    * February 22, 2026: Updated by Forrest for best-practice ribbon button tutorial
    */
    function openNewCaseForm(executionContext) {
    var entityFormOptions =
    {
    entityName: "incident",
    openInNewWindow: true
    }; textXrm.Navigation.openForm(entityFormOptions).then(
    function (success) {
    console.log("New Case form opened successfully in new tab.");
    },
    function (error) {
    Xrm.Navigation.openErrorDialog(
    {
    message: "Error opening new Case form: " + error.message
    });
    }
    );
    }


  9. Link the new Command to your button (Library = your web resource, Function = openNewCaseForm).
  10. Click Publish in Ribbon Workbench.
  11. Back in the solution, publish all customizations again.
  12. Result

    Open any model-driven app. The “Create Case” button now appears on the global command bar. Click it — the new Case form opens in a new tab.

    Note: Ribbon Workbench is still the only reliable way to edit the global command bar in 2026. The modern Command Designer does not support Mscrm.GlobalTab yet.

    That’s it. Test it and you’re done.



No comments:

Post a Comment