USD – Create new contact from a toolbar

Anyone who reads my blog will hopefully know that I like answering questions about Unified Service Desk for Microsoft Dynamics CRM.

This time the question was “How do I create a toolbar button that will allow me to create a new contact and open in a session?”.

I’m going to make a few assumptions here;

  1. That you already have a hosted control to hold contacts.
  2. That you have already created session lines to open contacts in sessions.
  3. That you have a toolbar already working but need to add a button to create a contact.

Step One – Create an action.

First of all, we are going to need an action to open a new page for a contact. There a couple of approaches I could have taken to this but I decided to simply open a new CRM page. This action to do this looked like the one shown below.

Notice that the hosted control is my global manager and the action is “New_CRM_Page”. Then in the data field I have added the name of the entity I want to open. In this case “LogicalName=contact” will do the trick. But you could adapt this concept to create other entities such as account, phone call etc.

Step Two – Create a toolbar button that calls the action.

I next added a toolbar button to call this action, I added mine to my main toolbar.

The detail of my button looked like this;

Button text will show in my toolbar, and the tooltip will show if I hover over the option. The show tab setting of contact is because it is the contact tab I want to position on if this button is clicked.

My order of 1000 is simply to position the button within my toolbar.

And finally I added the action I just created.

Step Three – Create a Window Navigation Rule

At this point it is worth testing your application, it may already work! In which case skip this step.

The reason it might work is a rule is likely to already exist that will start a session for contacts. If it doesn’t you’ll need to create one. The rule that opened the session for my contact looked like this;

Some things to note / understand about this rule.

  1. The order is 300 because I have some other rules I want to be evaluated first. It is important to understand the way window navigation rules are evaluated. Each rule is considered in order, the first rule that matches the currently opening tab will be triggered. Any subsequent rules that also match will be ignored! If no rule is found, then USD will attempt to follow the default behaviour which will be to load the entity in the current tab.
  2. Notice my rule has no from field. This means if this rule is reach regardless of what hosted control triggered the popup this rule will be considered.
  3. Route type, Popup. This is significant as you can only create sessions from a popup. Which is find in this situation as our new CRM page action is going to popup a new page.
  4. Destination is tab, as we want to load the contact page into a tab.
  5. Action is “Create Session”, as we want a new session.
  6. Target tab and show tan are both set to “contact”. (Which I’ve assumed already exists!)
  7. Finally, I set hide navigation bar to yes, simply because I like to restrict navigation in sessions. This is optional!

Below you can see that in my USD application I now have a NEW CONTACT button in my main toolbar. Clicking this opens a new session containing a blank contact.

Hopefully these details will have answered the question I was asked. J

5 thoughts on “USD – Create new contact from a toolbar

  1. Hi Sir,

    My experience : I had created a similar window navigation rule, which will open the contact into a new session, from contact search page, I had also enabled a ribbon on the contact search page, so when a user click on a “new button” on a contact search page ribbon, it will automatically open the new contact form into a new session, like the one you had shown above. Hence, instead of giving a button for this on tool bar, another better approach could be to enable a ribbon. Hope you agree 🙂


  2. Pingback: USD – The Book | Microsoft Dynamics CRM and Unified Service Desk

  3. Hi Neil,
    I am facing a problem on contact form within USD. After fully loading contact form, it got blank.
    I have stucked on this, Please help me out asap.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s