Showing CRM data in the Customer Care Accelerator


So you pulled the bits down for UII and CCA and built them… and you have a nifty Blue screen that looks like this:

image

Ok well that’s not very interesting.. but if your here then that means that your UII\CCA install is working!

So lets look something up.. ( make sure your CRM System has some data in it before you do this…You will need at least a contact record for this part )
Hit the “New Search” button in the upper left.

You will get a window like this..

image

Plug some data in and hit the Arrow..  you don’t need complete data just a part of the first or last name will do.  The CCA Code is doing a wild card search for you.

Select a record and hit enter…

Now your display looks something like this:

image

 

Better,  we have a bit of data to play with.
Now lets add in a Hosted Web Application to show us the CRM contact Record for the user that we just looked up.

Sessions and Context in UII\CCA

Before we do that.. its important to understand that CCA is a example composite desktop, built on top of User Interface Integration for Dynamics CRM 4.0 (UII).  UII does a lot of really cool stuff behind the scenes and manages a lot of bits for us.  Two of the important concepts that you need to keep in mind is that UII always puts our customer data in a “Session”, and that “shared data” for the session is shared in the “UII Context” for the Session. 

So why does this matter?

To bring in that CRM contact record by URL we need to know something about the customer.. specifically we need to know what their internal CRM ID is.  CRM, like a number of Microsoft Products, uses GUID’s to identify the customer.

So where do we get this ID? fortunately CCA has helped us out here,  when you search for the customer and selected it, CCA asked UII to create a session and added the customer information it had to the Session Context.

For the customer record above, the context looks like this:

<UiiContext>
<State>WA</State>
<CustomerID>cd14c2c5-715c-df11-9795-001a6b4be739</CustomerID>
<CustomerLastName>Adams</CustomerLastName>
<AccountID></AccountID>
<BillingAddress>
3397 Rancho View Drive
Redmond WA, 90000
</BillingAddress>
<Phone1></Phone1>
<Email1>someone@example.com</Email1>
<City>Redmond</City>
<Phone2></Phone2>
<CustomerName>Jay Adams</CustomerName>
<Street>3397 Rancho View Drive</Street>
<IsNewCustomer>False</IsNewCustomer>
<CustomerFirstName>Jay</CustomerFirstName>
<CustomerType>contact</CustomerType>
<AccountName></AccountName>
<ZipCode>90000</ZipCode>
<Country>U.S.</Country>
</UiiContext>

How did I get that?,  in the UII Quick starts there is a tool called the UII debugger that lets me see a number of things going on in a running UII desktop. One of the things it lets me do is see what the current context is.  I will do another post on how to turn on this tool, for now though, this is the Context structure that CCA creates by default.

So by looking at the context I see that there is a CustomerID tag at the top..
That is our current contact’s CRM ID.

Now that I see what UiiContext Key the CustomerID is in, I can move on and Add in a CRM window to the CCA desktop.

Adding the CRM Contact Page to CCA’s Desktop

Open up CRM and click on the Settings button, then choose UII Settings from the details area.

You should be looking at this :

image

We are creating a Hosted Application, so Click on the Hosted Applications area, and then click New on the Table list for Hosted Applications.

image

Ok, that’s going to pop up a window with some a bunch of fields in it.

Right now, the ones we care about are ;

Field Value
Name Contact
Hosted Application Type Hosted Web Application
Display Group MainPanel
  • Name is the Name of our Hosted Application, its up to you what you want to call it.
  • Hosted Application Type is the type of application we are hosting in the Desktop, in this case; a Hosted Web Application.
  • Display Group is where in the Desktop we want to put it…  in the case of CCA, the CCA Deployment Guide gives us a lay out of the panels on the desktop,  I pulled this diagram right out of the CCA Deployment CHM… you can look there for more information on CCA itself.

image

Populated your first tab should look like this:

image

Next, click on the Hosting Tab:

Here we will determine what sort of hosting we will use and what the starting URL will be.

On this tab the only thing we need to change is the URL, set it to about:blank

Why about:blank?
UII will initialize a browser instance when it load the application initially, if your just displaying static content that is not UII Context aware, then you would put the full URL in here and be done. However as we are associating the view with the Context, we will do that with a UII Action.

Now hit Save, You should be left with a view that looks like this:

image

 

Click the UII Actions item in the details panel..

You should see this:

image

Ok, UII Admin has Created the default action for our Contact application,  We just need to fill it in.

Double click on the default action, which will open that Action Details window.

Here we will need to fill out some information…

Field Value
URL http:\\CRMSERVER\CRMORG\sfa\conts\edit.aspx
Query String id=%CustomerID
  • URL is the base URL of the page you want to show, most if not all, of Dynamics CRM 4.0 is URL addressable, so in this case we are targeting the Contact page
  • Query String is the part of the URL after the ? so in this case ID=%CustomerID

for my example, this is what the entry looks like:

image

So what is the %CustomerID thing?

UII, when working with Hosted Web applications allows us to do inline URL Query String replacement from the UII Context using Context Key Replacement Strings. 
In this case the %CustomerID refers to the CustomerID context string that CCA populated with the Contact Guid.  Where the % is a Hint to UII that the next string is a Context Key

Seeing it work

Ok Click Save and Close and close down the CRM web browser.

Start up the CCA desktop again, and Look up Contact.

Now you should see :

image

Our CRM contact window is in there, and on the right guy..
Now Hit search again, and open another customer.

UII will create another session and allow you to switch between them.. and it even keeps state between them.

image

There you go.. a simple addition of a hosted application entry and your hosting in CRM data, and UI right from CRM.

This is just the surface of what you can do with UII, You can find more information about this sort of thing in the UII Development Guide CHM in the documentation directory for UII.

Also you can find specific information on the CCA implementation in the CCA Deployment guide CHM , in the Documentation directory of CCA.

Comments (6)

  1. from tr says:

    Thank you. Great post.

  2. Danny_Archer says:

    thanks alottt….post is very helpful

  3. Mila says:

    Thanks a lot yar…

    Plz dig for more n more links n  post hear..

  4. ss says:

    Great post! Are you planning an update for the new R2 Release? Thanks!

  5. Sisko says:

    "Tool called the UII debugger that lets me see a number of things going on in a running UII desktop. One of the things it lets me do is see what the current context is.  I will do another post on how to turn on this tool"

    We are still waiting )

  6. Tony says:

    Sisko you'll be waiting a long time, Matt has left the building…

Skip to main content