In Unified Service Desk (USD) for Microsoft Dynamics CRM it is not possible to create a session from an in place navigation rule. Or is it????
In Place and Popup Routes Explained
Here I will try to explain the logic behind how these routes work, if you aren’t interested you could jump straight to the solution section. But if like me you like to understand why and how things work please read on.
I’ll start with the science bit, there are two types of routes in USD. In place and popup. An in place route is triggered when the browser window is opened “in place” of the current window. This happens, for example, when you load a case from a sub grid on a contact form. Or in fact any existing record anywhere on any form!
A popup route happens when a “popup” occurs. Obviously! This typically happens when a new record is opened from an existing one or if you open an existing record from a list view.
It is common in Unified Service Desk to want to start a new session when a popup occurs. Although this isn’t always the case. It is therefore possible, with the help of a window navigation rule, to create a new session or route the new window to a tab when a pop up occurs.
The default behaviour of an in place route is to open the window within the current tab, essentially overwriting what the user is currently viewing. The default behaviour will happen if you have no windows navigation rules. (or you have loads and USD can’t find an appropriate one!) It is common to create a window navigation rule that opens the record in a new tab using a “Route Window” action.
It will therefore also be common to cover all eventualities by having two window navigation rules for each entity, one for each route type. For example, if I open a case from a sub grid on a contact form that will trigger an in place navigation. But if I click the “+” to create a new case that will trigger a pop up navigation. In this situation I would create two rules, one for in place and one for popup. But both could have the same action of “route window”. As in both circumstances I might want to open the case form in a new tab in the existing session.
Your navigation rule will typically look something like this …..
It is NOT possible to add a create session action to an in place route. Meaning it is not possible to open a new session when an existing record is selected from a sub grid on a form. Or is it????
Let’s imagine that you have a list of recent cases on a contact and instead of opening one of those in a new tab you would rather start a new session. How could that be achieved? If you took the navigation rule above and simply changed “Route Window” to create session this would not work. The rule would then be invalid and would be ignored. The most likely result would be the default action would be applied. Meaning the case would load in the existing tab. Or worse still you could find that another rule matches this navigation and something completely unexpected and strange happens!
Don’t forget the order of navigation rules is VERY important. USD evaluates them in order and will fire the first rule that matches the route being requested. Meaning a common problem when something strange happens will be the sequence of your rules is incorrect.
The solution
After that lengthy explanation I will now turn to the solution. At last!
I will demonstrate the solution with an example. As I’ve already mentioned cases loading from contacts let’s stay with that theme. I will therefore show how an in place navigation can create a new session. With smoke, mirrors and trickery is the answer!!
The steps are this ….
- Create a hosted control
- Create a popup action
- Create an in place navigation rule
- Create a popup navigation rule
Step One – Create a hosted control
This may seem strange! I initially attempted this solution without a hosted control but I found the replacement parameters I needed weren’t available without one. But in my example I didn’t want to show the case in the original session. So I created a “dummy” hidden hosted control.
Field | Description |
Name | This could be anything but I opted for simply calling this control “Hidden”. |
USD Component Type | CRM Page |
Hosting Type | IE Process (I always use IE process!) |
Application is Global | Not selected as this will be a hidden tab in your session |
Display Group | Hidden |
Step Two – Create a popup action
You will need to create an action that will force a popup. We have two possible actions to load url’s in USD. Navigate and Popup. Navigate loads the url in the current tab without triggering the window navigation rules. Popup however will evaluate the window navigation rules are therefore can load the record in a new tab. (Or even session!)
Field | Description |
Name | Hidden – Popup (URL)
Obviously you could use any name you liked! |
Order | Blank as I only need one action, so the order isn’t important here |
Hosted Control | Hidden, this is the name of the hosted control we created in step one. |
Action | Popup |
Data | url=[[URL]]
The [[URL]] replacement parameter contains the url which needs to be loaded. FYI: I think [[hidden.url]] would also work in this example! But I went with [[URL]] simply as it is a shorter name! |
Step Three – Create an in place navigation rule
Now for the smoke and mirrors bit!
We are going to need an in place navigation rule.
Field | Description |
Name | Case from Contact |
Order | 1 as that works for me! |
From | Contact
This is the name of the hosted control in which we are loading the case. In this example contact. |
Entity | incident
The schema name of the entity we are loading. So incident! |
Route Type | In place |
Destination | Tab |
Action | Route Window
I know we really want to create a session! But for now the action is route window. |
Target Tab | Hidden
This is the name of the hosted control we created in step one. |
Show Tab | Left blank, you can’t show a hidden tab!!! |
Having saved the nvatigation rule I then added the popup action we created to the rule. As shown below.
Step Four – Create a popup navigation rule
Now we come to the navigation rule that will finally create our session. The previous in place rule will have triggered a popup action. Doing so will make USD look at the navigation rules again. When it does this second rule will come into play. This time using a Popup route and a create session action.
Field | Description |
Name | Case from Hidden (Popup) |
Order | 1 as that works for me! |
From | Hidden
This is the name of the hosted control we created in step one. The popup action is triggered from that hosted control. |
Entity | incident
The schema name of the entity we are loading. So incident! |
Route Type | Popup |
Destination | Tab |
Action | Create Session |
Target Tab | Incident |
Show Tab | Incident
Target tab and show tab are set to incident as in my example I wanted to open a session based on the case. |
I hope you have found this explanation and example useful. My intention was to not only show how to create a session from an in place route but to also explain the workings behind my approach. Fingers crossed I have achieved that aim.
J
Leave a comment