I recently answered a question someone raised in the Dynamics Community on how to close all the currently open sessions in Unified Service Desk (USD) with one click. This is a very simple change to implement, this post explains how.
I am going to assume you already understand how to open sessions!
The steps involved are;
- Create some actions.
- Create a toolbar button.
Step One – Create some actions.
First of all I created 5 actions. Why 5? Well my maxNumberOfSessions option is set to 5. If yours if higher or lower than you’ll need a different number of actions.
Each action looked something like the one shown below. The hosted control is “Session Tabs” and the action is “CloseSession”.
Notice the Order field. I had this set so that each action would happen one after another.
Step Two – Create a Toolbar Button.
Next I created a toolbar button and added the five actions I’d created to that button. My button looked like this;
Some things to note;
- I called my button “CTI Toolbar – Close”, as I added this to a toolbar I was showing in my CTI Toolbar. You could obviously add yours to you main toolbar if you’d prefer.
- I uploaded a suitable image as a webresource. Its name was “crm_CloseQuote_16”. I “borrowed” it from the images that come in the Dynamics 365 SDK! (This step is optional.)
- I added all my actions, you can see that the order field gave them a logical sequence.
- I added an enable and visible condition. As I only wanted a close sessions button to show when a session was open. My condition was “[[$Context.LogicalName]+]”!=”” (FYI, other conditions might have worked I just opted to look for the presence of an entity name in my context, as I will always have that when a session is open.)
My button finally looked like this ….
I hope you can see this is a dead simple change but one that might be useful.
J
Leave a comment