When creating toolbars in Unified Service Desk (USD) for Microsoft Dynamics CRM, have you ever noticed that you can associate one toolbar with more than one hosted control? And have you noticed that the toolbars have an order field?
I had but had never “played” with these until now!
When creating a navigation toolbar, it maybe common that you have the same buttons repeated. For example, back, forward and refresh buttons. Until now I have repeated these buttons and actions on multiple navigation toolbars. When you’re using lots of navigation toolbars this can become time consuming. Plus, repeating stuff is never good design!
My toolbars often contain the same first 4 buttons. (Home, Back, Forward and Refresh). But then after those I have additional buttons which are specific to each tab.
In this post I describe how I created generic buttons whilst still being able to have additional buttons which are unique on each hosted control. The steps involved included;
- Create some generic actions for Home, back, forward and refresh.
- Create a further (optional) generic action for show tab.
- Create a generic toolbar.
- Also create custom toolbars.
In this example I am going to follow these steps for my contact and account entity. Obviously you can adapt this approach to work with other hosted controls and toolbar buttons. (e.g. Maybe you would like a generic toolbar button to call a MoveToPanel action to move tabs from the MainPanel to a FloatingPanel etc etc.)
Step One – Create Some Generic Actions
Let’s start by creating CallDoActions for each of the actions I want to associate with my generic toolbar. I created four actions, all of which are very similar.
The concept here is to fire a CallDoAction from my Global Manager. That will then trigger an action on a named hosted control. By using the replacement parameter of [[SourceApplication]] I can create a generic action.
application=[[SourceApplication]] action=<<The action you'd like to fire>> data=<<Any data needed by the action>>
My back action looked like this ….
Hopefully you can see that I repeated this process for each of the actions I needed. In my data field I simply had action=GoForward, action=GoHome, action=Refresh or action=GoBack!
Step Two – Create a further (optional) generic action for show tab.
In my toolbar buttons I typically set the show tab field to be the current tab. In a generic approach that wouldn’t work. So I also created a generic show tab action. I could probably have skipped this and got away without it. But thought I should show it here anyway, as it demonstrates a slightly different process.
My approach to show tab was actually very similar but the [[SourceApplication]] field is used slightly differently.
application=CRM Global Manager action=ShowTab data=[[SourceApplication]]
Step Three – Create a generic toolbar.
Now I wanted to create a generic toolbar, so first of all created a toolbar. Notice that the order is 1. (I’ll come back to that in a minute.)
Normally you would associate the toolbar with just one hosted control. But see below that I have added both contact and account to this toolbar. (And later I will add more!)
I next created 4 toolbar buttons on this generic toolbar. As shown below.
The details for each button were pretty similar, so I won’t show all of them! But the Go Forward button looked like this;
Notice that I have added the action for go forward and show tab to this button. As we created in step one and two.
Step Four – Also create custom toolbars.
I had already got toolbars for contact and account. So what I actually did was remove my existing buttons that were now generic.
This meant that contact (for example) was now associated with two toolbars. One thing I did need to do was change the order on the toolbars for contact and account to two. As shown below.
Finally, I tested my application, in my case my final toolbar looked like this. Notice that I have the four generic buttons followed by several specific to the contact tab. Also notice that a small gap exists between the first and second toolbars. I actually quite liked the presence of this space.
Hopefully you will have found this post useful and also hopefully you can think of other ideas on how to combine CallDoAction and [[SourceApplication]] to make further actions generic. J
2 thoughts on “USD – Generic Toolbar Buttons”
Great Article………Thanks for being our coach in the saga of USD learning 🙂
Pingback: USD – The Book | Microsoft Dynamics CRM and Unified Service Desk