On several occasions I have been asked how to create an inbound phone call activity directly from a toolbar button in Unified Service Desk (USD) for Microsoft Dynamics CRM, in this post I will address this question.
Firstly, let me say, this isn’t my personal preference on how to start a session in USD! I much prefer to search for the contact / account first and then start a session in the context of the selected record. It has always seemed logical (to me) to first find the person or company calling and start from that point. But I agree there are cases when you want to open the phone call and start recording details before you have established who you are talking to. Meaning that in some circumstances it might be logical to start the session in context of a “blank” phone call.
In this example I will show how to create a toolbar button, that when clicked will open a session containing a partially completed inbound phone call record.
I am going to assume you already understand the basics of how to create hosted controls, actions and start sessions in USD. But I will try to still explain the detail as I progress.
The steps involved are;
- Create hosted control. (Phonecall)
- Create Session Lines.
- Create a “CreateEntity” action.
- Create a UII Action on your toolbar.
- Create an action to open phone call.
- Create a tool bar button.
- Create a window navigation rule.
Step One – Create hosted control. (Phonecall)
As with most things USD related, I am going to start by creating a hosted control. This time I simply need a hosted control that will be my phone call tab. Mine looked like this;
The most important details are as follows;
|Display Name||Phone call([[phonecall.subject]])
I decided to show the subject of the phone call as my tab name. You could, of course, name the tab differently.
|USD Component Type||CRM Page|
|Allow Multiple Pages||No|
|Hosting Type||IE Process
I always use IE Process!
|Application is Global||Not selected as this is going to be a session tab.|
Step Two – Create Session Lines.
Depending on your requirement you may need to create a session overview and session name in the session lines section of USD.
In this example I will keep things simple and just create a session name, this will define the tab name for my session.
Creating a session name is pretty simple, I just navigated to Session Lines in USD and created a new one. In my simple example I just set the type to “Session Name” and “Display” was set to the same approach I’d taken with the hosted control name. (Phone call([[phonecall.subject]])
Step Three – Create a “CreateEntity” action.
Next I created an action to create my phone call. Later I would open it, this action simply creates the phone call in the CRM database. Now normally when we create a phone call I would want to populate all of the mandatory fields but in this case I will leave the “from” field blank. The user will need to enter the details of the contact or account later.
|Name||CRM Global Manager – Create Entity (Inbound Phone call)|
This is important! The order will make sense in a second. But I have selected 10 as this will be the first of two actions I want to execute.
|Hosted Control||CRM Global Manager|
subject=Inbound Phonecall to [[$User.fullname]]
To explain ….
LogicalName is the schema name of the entity I want to create.
directioncode is a Boolean value on phone call. Which needs to be false for an inbound phone call. (You could set to “true” if you wanted to create an outbound call in this manner.)
subject, this is the subject of the phone call. Notice I have added the name of the agent to the subject.
to, the phone call is obviously “to” the current user. But the “to” field is a party list and therefor has some special logic to set it.
Step Four – Create a UII Action on your toolbar.
Next I needed to create a new action. Let me explain why …. We will need to fire an action to open the phone call created by the action we defined in the previous step. This will be done by using an Open_CRM_Page action. Normally we would run these from the CRM Global Manager. However, in my example I wanted to explicitly know when the phone call had been opened from the toolbar button. (As only then would I want to create a session.)
To create the new UII Action, open your toolbar container hosted control and navigate to the UII actions. (Note: I am assuming you already have a main toolbar!)
Assuming you don’t already have an “Open_CRM_Page” action, click “ADD NEW UII ACTION” and simply add one called “Open_CRM_Page”. Mine is shown below.
Step Five – Create an action to open phone call.
Next we will want to create an action call that will use our new Open_CRM_Page UII action. My action looked like this;
|Name||Toolbar Container – Open CRM Page (Inbound Phone call)|
This is important! The order will make sense in a second. But I have selected 20 as this will be the second of two actions I want to execute.
|Hosted Control||Toolbar Container|
id=[[$Return.CRM Global Manager – Create Entity (Inbound Phone call)]]
To explain ….
LogicalName is the schema name of the entity I want to open.
id is the GUD of the record you want to open. In our case we want to open the return created with the pervious CrateEntity action. For which, the GUID is returned to us in a replacement parameter which has the same name as the action that created the record.
Step Six – Create a toolbar button.
Now we have most of the components we need, so a toolbar button can be created to create and open the phone call. I already had a main toolbar so I simply added a new button. Mine is shown below. (I am assuming you understand the basics of toolbars.)
|Name||Phone call Toolbar Button
You could call your anything!
This is a standard phone icon image.
|Button Text||I only wanted an icon, so I left this blank.|
I picked 50 as I wanted it to be my last button and I already had several. Yopu could use a different order to position your button as required.
|Tooltop||Create Inbound Phone Call|
As I want the phone call to have focus when it is opened.
|Actions||Having saved my toolbar button, I added the two actions I had just created. The first creates the phone call and the second opens it.
Hopefully the order now makes sense!
Step Seven – Create a window navigation rule.
One final step is needed. You will need a window navigation rule to tell USD to create a session if a phone call is opened directly from the toolbar button you just created. My rule looked like this;
|Name||Phonecall from Toolbar|
Note: 1 worked for me! Keep in mind that all of your navigation rules will be evaluated in order. You may need to tweak the order.
As I added the Open_CRM_Page action to my toolbar container the “from” here is that. This is important as this rule will not be triggered if I created a phone call from anywhere else in my USD solution. (In mine, for example, I can also create a phone call from an agent script.)
This is the schema name of the entity being loaded. “phonecall” probably already exists but if not you will need to create it.
|Route Type||The Open_CRM_Page action will trigger a popup, so our route type needs to be “Popup”.|
|Hide Navigation Bar||I set mine to “Yes” as I like to restrict sue navigation. You could use yes or no!|
In my USD interface you can see that I now have a phone call icon, clicking this will create a phone call record and open it in a session. As I said at the start this wouldn’t be my preference on how to start a session but sometime it is an approach that might be needed. If you do this in a production environment you might want to think about how the users will interact with the form and how you force them to enter a “from” field etc. (Maybe some validation on your SessionCloseRequested event.)
Hopefully this post has given you some insight in how to create some USD functionality that is commonly requested. J