Adding Global Command Buttons to the Unified Interface

If you've used the new Version 9 Unified Interface so far then you'll know that there is no advanced find button yet. I am sure that it won't be long until this feature is added in some form and indeed much of the time the Relevance Search finds what you need quickly.

That said, I thought I'd demonstrate how to add command buttons to the top bar in the Unified Interface by using the example of adding an Advanced Find button similar to the Web Client.

What is the Global Command Bar?

The Unified Client has a similar looking top bar to the Web Client except it doesn't include the site map since it's moved to the left-hand navigation.

We can now add command buttons to this top bar, to the right of the + button.

How to add a Global Command Button

1. Create a new solution and add the Application Ribbon using

2. Add a new JavaScript web resource containing the following code:

var UCIAdvancedFind = {
    open: function(){
        var advFindUrl = Xrm.Utility.getGlobalContext().getClientUrl() + "/main.aspx?pagetype=advancedfind";
        Xrm.Navigation.openUrl(advFindUrl,{width:900,height:600})
    },
    isDesktop: function() {
        return Xrm.Utility.getGlobalContext().client.getFormFactor()==1;

    }
};

The isDesktop function is used on an EnableRule to ensure that the Advanced Find button doesn't show on the phone/tablet client because it will not work.

3. Add a new SVG icon to the solution to be used on the Global Command Button.

4. Load up the new solution in the Ribbon Workbench and locate the Mscrm.GlobalTab group in the Home Command Bar:

5. Drag a button into the Mscrm.GlobalTab isv area:

6. Create an Enable Rule that calls some custom JavaScript:

7. Create a command that is linked to the button that calls some JavaScript and has the Enable Rule:

Once this is published it'll show up in the top bar:

You can also add flyout menus to this bar. If there isn't enough room the Global Command Bar will show the overflow drop down menu like a flyout button.

Remember – this is only available on the UCI – which is awesome by the way!

You can download the managed solution for this button:

UCIAdvancedFind_1_0_managed.zip (3.60 kb)

Pingbacks and trackbacks (1)+

Comments are closed