I was recently asked a question about how to open a session in USD from a session, I like answering questions about Unified Service Desk (USD) for Microsoft Dynamics CRM. So here is one possible answer …..
To give an example, I needed to think about this in context of my own USD application. So this answer isn’t an exact mirror of the question but hopefully it could be adapted for other situations.
In my application, whenever I open a contact if they have a parent account I also open that in a tab within that session. I thought it might be useful to add a button to the parent account that would start a new session in context of the account.
Normally when we open an account (or anything) within a session a window navigation rule will be a route type of “in place” and will fire an action of “Route Window”. This will then open the account in a tab within the current session. When it comes to creating sessions the route type will always need to be “Popup” and you will want to fire a “Create Session” action. So how can I achieve the requirement …… actually the answer was pretty simple. J
I’m going to make some assumptions here, firstly that you already have sessions opening in USD. And that within that session you are already able to open a tab containing an entity. In my example, I am opening a session for the contact and I have opened a second tab containing a parent account.
The steps I follow were;
- Create an action to close the parent account window
- Create an action to pop-up an account window
- Add the actions to a toolbar on the parent account
- Create a window navigation rule to create the session
Step One – Create an action to close the parent account window
As I was about to allow the user to open a session for the parent account it seemed logical to close the current tab. As otherwise they would have had the parent account opened in two places. Which might feel confusing. This is a pretty simple action. The hosted control in my example was “Parent Account”, as that is the name of the tab holding my account. Then the action is close.
I set my order to 1, as I decided to close the current tab before opening the new session.
Step Two – Create an action to pop-up an account window
As I have mentioned normally when we open an existing entity in USD this will trigger an “in place” route type. In this circumstance though I needed to force the account to popup. Allowing me then to create a session.
My hosted control is “Global Manager”, the idea being global manager is hidden. So no additional tab will show in my current session.
My action is popup. Popup is different to navigate, mainly as calling a Popup account will trigger the window navigation rules. Important as we are going to need these to create our session.
In my example I set the data field to “url=[[Parent Account.url]+]”, you will have a .url replacement parameter on any CRM Page in a hosted control. In my example, this is useful as it is the url of the account I want to open.
I set the order to 10, so that this action would be triggered after the close action I described in step one.
Step Three – Add the actions to a toolbar on the parent account
I already had a navigation toolbar on my parent account tab, so I simply created an additional button to call the two actions I just described.
So clicking the button would close the current tab and open a new session for that account. My button looked like this ….
Step Four – Create a window navigation rule to create the session
Next I needed a window navigation rule to trigger opening a session from an account popup came from my parent account tab. My rule looked like the one below.
You can see that I set my “from” to “Parent Account”. (If I had used the variation I mentioned of triggering the popup from global manager I would have set the from to global manager!)
The entity I am opening is account, my route type is popup. And my action is “Create Session”. And finally the target and show tabs are set to account.
To show this change in action I have created a very quick video ….
Hopefully this post has answered the question I was asked and shown the change in action. J
Leave a comment