If you read my blog I hope you know that I love answering questions about Unified Service Desk (USD) for Microsoft Dynamics CRM. Today I was asked a great question about how to open an associated view whilst creating a session.
I thought this was a great question as it might be a common requirement to open tabs containing associated views of cases or opportunities as an account loads. (Or any associated view for that matter.) Commonly I see these views being opened in tabs when users click on toolbar buttons, why not save that click and open the tab automatically?
The scenarios for my example is this, you open an account from a search screen or maybe from a dashboard. Selecting the account will create a session and open the account tab in the session. But you’d also like to open another tab at the same time containing an associated view of cases.
I am going make an assumption here that you are already able to open an account in a new session. But you need to alter its window navigation to open the associated view.
The steps involved are as follows;
- Create a hosted control
- Create an action to display associated view.
- Create an ExecuteOnDataAvailable action.
- Add an action to your window navigation rule.
Step One – Create a hosted control
If you haven’t got one already you will need a hosted control to hold your associated view. Mine looked like this;
Field | Description |
Name | Associated Cases |
Display Name | Cases |
USD Component Type | CRM Page |
Allow Multiple Pages | No |
Hosting Type | IE Process |
Application is Global | Unselected.
This field is not selected as I want my associated view to be part of the session. I have been asked how to show the associated view as a global tab, that is as simple as selecting this option! |
Display Group | It made sense for me to display the associated view in my left panel. So I selected “LeftPanelFill”.
You could alternatively use MainPanel or even FloatingPanel. |
Step Two – Create an action to display associated view
Again, if you haven’t got one already you will need an action to display the associated view. In my example I have gone with cases for an account. Hopefully you can see how to adapt this action for other entities. (Such as opportunities from a contact etc.) My action looked like this;
Field | Description |
Name | Associated Cases – Asscociated View (From Account) |
Hosted Control | Associated Cases
The hosted control we created in step one! |
Action | AssociatedView |
Data | navItemName=incident
Id=[[account.Id]] tabset=incident_customer_accounts type=1 |
Step Three – Create an ExecuteOnDataAvailable action.
Next you will need an ExecuteOnDataAvailable action! Why???? The reason is that as the navigation rule runs to create your session the account details might not yet have loaded into the replacement parameters. And if you try to run your action to view the associated actions before that has happened it will fail.
I got round that issue with an ExecuteOnDataAvailable action that will pause processing until the required replacement parameter is available.
My ExecuteOnDataAvailable action look like this;
Field | Description |
Name | CRM Global Manager – ExecuteOnDataAvailable (Account.Id) |
Order | 50 (As I wanted this action to run last when I create my session! You might be abel to leave this blank!) |
Hosted Control | CRM Global Manager |
Action | ExecuteOnDataAvailable
TIP: If this action doesn’t exist simply create a new uii action on your CRM Global Manager! |
Data | [[Account.Id]]
As this is the replacement parameter I wanted to wait for before continuing. |
Having saved my ExecuteOnDataAvailable action I added my action to display the associated view as a sub action. As shown below.
You access the sub actions from the navigation ribbon the ExecuteOnDataAvailable action. All we are doing here is saying which action(s) to run when the data is available.
Step Four – Add an action to your window navigation rule.
Finally, we need to edit our window navigation rule that creates the session. My existing navigation rule looked like the one below. It is simply opening a session when the account is selected.
If you need help on how to create a session I have blogged on this before here.
What I needed to do next was alter the actions that run when my session starts. As shown below I simply added the action I previously created.
Now when I open an account an extra tab shows in my left panel. Clicking on that panel will show the cases associated to the account.
Hopefully this post will have been useful if you want to open associated views as sessions are created. J
Leave a comment