So you pulled the bits down for UII and CCA and built them… and you have a nifty Blue screen that looks like this:
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..
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:
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.
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.
Open up CRM and click on the Settings button, then choose UII Settings from the details area.
You should be looking at this :
We are creating a Hosted Application, so Click on the Hosted Applications area, and then click New on the Table list for Hosted Applications.
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 ;
Populated your first tab should look like this:
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:
Click the UII Actions item in the details panel..
You should see this:
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…
for my example, this is what the entry looks like:
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
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 :
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.
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.