Tag Archives: crm

CRM List View URLs

If you would like to render a CRM list view without any ribbon header (perhaps to embed in an iframe or in an external app) then you can use a URL similar to the below:

https://democorpaugust.crm5.dynamics.com/_root/homepage.aspx?etc=10007&pagemode=iframe

You will need to localise the org name to your environment and replace the etc code with the entity type code of the entity you are wanting to display.

The above URL gives me a window like this:

image

Rather than the window the Copy Link URL provides:

image

Advertisements

Installing the Customer Care Accelerator (CCA) for CRM 2011

Today I’ve been having fun with CCA and CRM 2011.  The install process is a little cumbersome so here’s a install guide that might just save you some time.  I strongly recommend reading this before attempting the install.  

For those that just want to see what CCA looks like, here’s a sneak peak:

image

WARNING: you shouldn’t even bother looking at CCA unless you are down with the fact that a CCA CRM implementation is in reality a complex custom dev project.  CCA is not a solution, it’s not really an accelerator, it’s a development framework.  It’s still very cool, but if undertaking a large custom dev project is not your thing… walk away.

Background on the Installation Process:

First, some background that will help.  There are 2 layers that you install.  First is the Microsoft User Interface Integration framework.  Second is the Customer Care Accelerator (CCA) reference implementation.  The CCA bit is essentially an example deployment of the framework.   The download files are source code.  You need to follow the instructions to adjust the source code and compile it to build the Agent Desktop.  The Agent Desktop is the app that the end user would use.  If you want to see what CCA looks like this is your end game.

Also note you can install CCA onto a VM and configure an on premise system or you can install CCA on to your laptop and configure it against a CRM Online instance.

Here’s the install steps:

1. Download the CCA files from the CRM Marketplace here

image

2. The download file is a cab file that contains a zip file.  Unzip that file to your desktop (note: you might find this a slightly peculiar process, but with a bit of juggling you’ll get there)

image

Your unzipped folder contains an Accelerator folder (the CCA install files) and a UII folder (the UII framework install files).  You also get a couple of handy deployment guides.  You’re going to need to work through those, I’ll point you at those as we go along.

image

3. Open the UII folder and run either the 32 or 64 bit executable inside (depending upon the machine on which you are working on).  Not much guidance required for this wizard, I went with the Complete install and installed to the default location.

4. Go back up a folder level and then open the Accelerator folder.  Again, run the 32 or 64 bit executable inside.  This one unzips a few more files into the install folder.

5. You should now have a Microsoft UII folder containing all the source code.  We work from this folder from now on (apart from the deployment guides which are back in that folder on your desktop)

image 

Next step, is to import some solution files into your CRM organisation.  A CRM 2011 organisation is required here.  The CCA Agent Desktop is used to present and integrate multiple business applications to end users inside a single desktop.   This accelerator demonstrates this using Microsoft CRM as an example application.   But CCA also leverages CRM as its backend data store for holding configuration data.  So there’s a bit of dual use going on here.    As a result we need to import 2 solution files into the CRM Org you are going to use to demo CCA.   These solution files both provision the backend configuration requirements of CCA and also configure CRM’s sales, service and marketing features to give us some demo scenarios that can be showcased through the Agent Desktop.

6. Import the following 2 solutions into your CRM organisation:

image

and:

image

7. Whilst you are in CRM there’s a couple of data files to import as well:

import the file below:

image

and import this file too (map to the UII Hosted Applications entity and fix the 2 field mapping errors before you process the file):

image

8.  And if you haven’t loaded the standard sample data into your CRM Organisation do that now (In CRM, go to Settings, click Data Management, select Sample Data and then follow your nose).

9. Open the UII Deployment Guide chm file and follow the instructions in the 2 sections highlighted below:

image

Note: you will hit an issue when you try and compile the CompositeUI.Windows solution.  I found the answer to this issue on this post.  You’ll need to change the target framework version of the CompositeUI.Windows to be framework 4.0 (right-click on the CompositeUI.Windows project, go to the properties, change the target framework there). After doing so you’ll also need to remove the references to PresentationCore, PresentationFramework, UIAutomationProvider, and WindowsBase and add the respective 4.0 versions. They can be found in this folder:

%windir%\Microsoft.NET\Framework\v4.0.30319\WPF

10. Open the Microsoft.Crm.Accelerator.Cca.AgentDesktop.sln solution file and build the solution.  This will generate the RIConfigLoader application for us.

image

11. Run the RIConfigLoader executable from the location below:

image

12.  Create a new connection, provide the credentials required.   If uncertain of your CRM Service URL you can find this in CRM at:  Settings  –> Customizations  –> Developers Resources.   Look there for the Discovery Service URL.

image

13.  Once connected, select your Organisation and then click Deploy:

image

14.  Next, create a TEMP folder on your local C:  (the Agent Desktop is going to want to write a log to this location and will crash if it doesn’t exist)

image

15.  Locate the Agent Desktop’s config file and open it in Notepad or Visual Studio:

image

16.  Map the organizationServiceUrl key to your CRM organisation.  Again you can get this value in CRM at Settings –> Customizations –> Developers Resources.  The value you want this time is the Organization Service URL.   Also, if you are connecting to CRM Online change the authenticationMode key from “Windows” to “Online”.

image

17.  Launch the Agent Desktop:

image

 

And all going well up will pop the CCA Agent Desktop, complete with CTI toolbar and embedded CRM screens:

image

The toolbar buttons take a little while to become responsive so give the screen a little while to ‘warm up’.  

Click the Search button in the top left corner to initiate a customer search.  Once you select a customer there a CCA session is created for that customer.   Click the blue arrow to reveal an important part of the desktop…

image

… and you will see the customer’s details and a workflow list from which you can initiate a CCA workflow:

image

Click “Service Case by Phone” for example and the tasks for that workflow appear on screen:

image

and as you click through those the main window reveal screens relevant to that workflow task.

 

Hope someone out there find this useful Smile

Regards,

Gareth.

CRM 2011 Dialogs–A couple of gotchas

A couple of things to look out for as you start writing Dialogs:

  1. If your Dialog has branching logic make sure you don’t use the Responses from those branches in any later actions after the branching as those Response values will not be available in those scenarios when the user branches the other way, and CRM doesn’t like that.   To get around this make use of Variables within your Dialog.  Initialise a Variable at the start of your Dialog, update it within your branch and then you can happily refer to the Variable later in the script.
  2. Beware of placing actions such as creating records and sending emails in amongst Pages of your Dialog, they’re better placed at the end of your script firing only after the user has clicked Finish in the Dialog.  Reason for this is the Dialog UI happily allows users to navigate backwards and forwards within the Dialog.  If you have a record creating firing between pages 4 and 5 of your script that record creation will happen not only the first time the user progresses to page 5 but if they hit previous, go back to page 4 and then progress on to page 5 again then yeap you guessed it you will get another record created.

HTH Smile

Gareth

‘Sharing’ Secured Fields in CRM 2011

An update to my earlier post on Field Level Security.  Here I clarify the functionality and provide new commentary on the Sharing feature related to Field Level Security (something I spotted during my review of the training material for the CRM 2011 exams)…

Activating Field Level Security:

  1. Create a Solution and add the Entity(s) you wish to lock down into the Solution
  2. Locate the Field(s) under each Entity and activate each of them for Field Level Security (there’s a new checkbox there on the Field Definition) image_thumb[2]
  3. As soon as you publish this change the Field Level Security restriction will be applied to all users except those assigned the Systems Administrator security role.   The field is instantly read only and non-editable for your users.   Your next step is to configure CRM’s  Field Level Security model to grant permissions out to your users.

Granting Access to Secured Fields:

  1. For each collection of field level permissions you want to grant out to a collection of users you will create a “Field Security Profile”.  These can be created from your Solution or from Settings –> Administrationimage_thumb[5]
  2. Assign Users and/or Teams to the profile:  image_thumb[11]  – note: if a user is associated to multiple profiles they end up receiving the least restrictive permissions
  3. Grant the profile permissions over the fields that have been secured:image_thumb[10]
    • Each secured field will automatically appear in the list, with Create, Read, and Update access all initially set to “No”.
    • Pick the field(s) that you want to grant access to and change their value’s to “Yes”
  4. Publish your changes.
  5. Done Smile

How the end result looks:

  • Fields enabled for Field Level Security appear with a Key symbol against them
  • When a field is secured such that a user has no READ permission that user will see the field on the CRM form but the data will be masked out, and in CRM views the column will be blank
  • When a field is enabled for Read but locked for Update it appears disabled on the form

image

 

Sharing Field Level Permissions:

The Sharing feature we are used to from CRM 4.0 has been extended in CRM 2011 to support the Sharing of Field Level Permissions.  A user who has been assigned a Field Security Profile granting them permission to a secured field can potentially share that Field Level Permission to another user (or Team) who currently does not have access to that secured field. 

I say ‘potentially’ as the ability to share Field Level Permissions is constrained by a new Security Role: “Field Sharing”:image_thumb[14] 

Here are the steps to Share Field Level Permissions to another user:

From the CRM record that you want to share click the “Sharing” button on the Ribbon and select the option “Share Secured Fields”:image_thumb[19]

The rest is pretty simple, just like normal sharing (although a bit ‘clicky’).   

regards,

Gareth.

CRM 2011 Upgrade–Outlook Client Considerations

Here’s an excellent post that spells out everything you need to know:

http://blogs.msdn.com/b/crminthefield/archive/2011/03/16/ten-helpful-crm-outlook-2011-tips.aspx

Bottom line is: get your CRM 4 clients onto at least rollup 10 and then you are ok to upgrade the server to CRM 2011.  Your CRM 4 clients will continue to function – even with offline data – and you can upgrade the clients at your leisure (with some constraints around going offline). 

Getting Started with CRM 2011 Online Fetch XML Reporting

Here’s some hints on how to get up and running writing SSRS reports in Visual Studio for CRM 2011 Online.  Target audience is those folk who have written SQL query based SSRS reports for CRM 4.0 who need to up skill on the use of Fetch XML in their report development.

 

Getting Setup

Here’s what you need:

– Install SQL Server 2008 R2 Business Intelligent Development Studio from your SQL Server install media

– Install Microsoft Dynamics CRM 2011 Fetch Authoring Extension, which you can download from here.

This will give you the ability to create SSRS reports inside Visual Studio 2008 using the Microsoft Dynamics CRM Fetch data source.  If you didn’t already have Visual Studio installed the install of SQL Server Business Intelligent Development Studio will load it onto your computer (you get a cut down version of VS that just supports report development). 

Creating a report is then as per what you are used to except rather than choosing Microsoft SQL Server as your data source you chose Microsoft Dynamics CRM Fetch and you provide your CRM 2011 online URL, Organisation Unique Name and Windows Live credentials.

The connection string needs to be in this format:

image

The first bit you can just copy and paste from Internet Explorer.  The second bit is the unique identifier assigned to your Organisation. 

WARNING!: this is not the organisation alias included in your CRM Online URL, it is a different value that you have to go here to find by going to Settings –> Customisation –> Developer Resources:

image

The value you want is the one specified as the Organization Unique Name:

image

Now, you only need this if your windows live account is associated with more than one Organization but if you are writing custom reports I suspect you’ll be associated to more than one.

Let’s create our first report… 

Start in CRM 2011 in Advanced Find and create a query for your report, say – All Open Opportunities with an Estimated Close Date in the next 3 months.  Select columns to match the fields you will want available to you in the report designer:

image

Click the Download Fetch XML button and save the Fetch XML query to your desktop:

image

Now jump over to SQL Server Business Intelligence Studio, start a new Report Server project, add a new Report and configure the data source as described earlier:

image

Click Next, and then paste in your downloaded Fetch XML:

image

Now continue through the Report Wizard to define the report appearance and then run the report:

image

Tiding up the report appearance should be business as usual for you if you have built SSRS reports before so I won’t go into that here.

If you missed some fields you can either redo your Advanced Find and paste new Fetch XML over the existing Dataset’s query or just edit the query in the same manner that would have if you had used a SQL query:

image  image

Next, let’s add a parameter to the report.  The easiest way to do this is to start with a Fetch XML statement that has a hardcoded condition in it (like ours does)…

image

… and then swap out the hardcoded value for a parameter variable (anything you like so long as it starts with an “@”):

image  

Run the report and you will see that the heavy lifting has been done for you and a (fairly rough looking) report parameter has been configured for you and it immediately works:

image

You can then tidy the parameter up as you normally would, be editing its prompting text and setting a default value, etc:

image  image

And it won’t be long before your report becomes reasonable looking and a bit more bit functional:

image

 

Happy report writing!

 

p.s. Fetch XML has a few limitations still which will quickly surface as you start building reports.  You need to be aware of these:

  • You cannot specify left outer joins – e.g. The following is not supported: “Select all Accounts who do not have a related Completed Appointment record”
  • You cannot specify group by / sum queries  – e.g. The following is not supported: “Select Account Name, count(*), sum(est. value) from Account Group By Account Name”  – You can only select the records in detail and then perform the aggregation in your report.  But…
  • Fetch XML queries return a maximum of 5000 records.

If these are shot stoppers then your options are:

  • Deploy CRM 2011 on premise rather than online
  • Use SSIS (or similar) to retrieve CRM data each night to create a local CRM data source
  • Use plug-ins (or similar) to populate aggregate fields / aggregate entities / left outer join indicator fields

Quick Reference for Common CRM 2011 Chart Customisations

The most common Chart customisation requests I’m hearing from customers relate to showing 2 data series on 1 chart.

Standard CRM configuration options in the UI only allow you to plot one data series on a graph, i.e. one field value.   If you want to show say Actual vs. Budget visualisations you need to do a bit of customisation:

image

And the same is true if you want to show stacked column charts like the one below:

image

Good news is this stuff is really easy to learn and really quick to action.

Here’s the steps:

1. Start by creating one or more Charts that are similar to what you want.

To get the Chart shown in screenshot 1 I first created a Column Chart like the below that gave me the sum of Actual Revenue per Customer…

image

And a Line Chart like the below to give me the sum of Est. Revenue per Customer…

image

2. Export each of these Charts to XML and save to your desktop.

3. Our approach here will be to modify the definition of the exported “Actual Revenue Column Chart” to come with the new definition of the new Chart.  Open that XML definition in Visual Studio.

The code snippet below contains the final result containing each of the following changes:

<visualization> 
  <visualizationid>{182867B5-3954-E011-8E49-1CC1DE6E4B49}</visualizationid> 
  <name>Actual vs. Est. Revenue by Potential Customer</name> 
  <primaryentitytypecode>opportunity</primaryentitytypecode> 
  <datadescription> 
    <datadefinition> 
      <fetchcollection> 
        <fetch mapping="logical" aggregate="true"> 
          <entity name="opportunity"> 
            <attribute alias="aggregate_column" name="actualvalue" aggregate="sum" /> 
            <attribute alias="aggregate_column2" name="estimatedvalue" aggregate="sum" /> 
            <attribute groupby="true" alias="groupby_column" name="customerid" /> 
          </entity> 
        </fetch> 
      </fetchcollection> 
      <categorycollection> 
        <category> 
          <measurecollection> 
            <measure alias="aggregate_column" /> 
          </measurecollection> 
          <measurecollection> 
            <measure alias="aggregate_column2" /> 
          </measurecollection>           
        </category> 
      </categorycollection> 
    </datadefinition> 
  </datadescription> 
  <presentationdescription> 
    <Chart> 
      <Series> 
        <Series IsValueShownAsLabel="False" Color="55, 118, 193" BackGradientStyle="TopBottom" BackSecondaryColor="41, 88, 145" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40"></Series> 
        <Series BorderWidth="3" ChartType="Line" Color="255, 0, 0" MarkerStyle="Square" MarkerSize="9" MarkerColor="37, 128, 153" MarkerBorderColor="37, 128, 153"></Series> 
      </Series> 
      <ChartAreas> 
        <ChartArea BorderColor="White" BorderDashStyle="Solid"> 
          <AxisY LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181" IntervalAutoMode="VariableCount"> 
            <MajorGrid LineColor="239, 242, 246" /> 
            <MajorTickMark LineColor="165, 172, 181" /> 
            <LabelStyle Font="{0}, 10.5px" ForeColor="59, 59, 59" /> 
          </AxisY> 
          <AxisX LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181" IntervalAutoMode="VariableCount"> 
            <MajorGrid LineColor="Transparent" /> 
            <LabelStyle Font="{0}, 10.5px" ForeColor="59, 59, 59" /> 
          </AxisX> 
        </ChartArea> 
      </ChartAreas> 
      <Titles> 
        <Title Alignment="TopLeft" DockingOffset="-3" Font="{0}, 13px" ForeColor="59, 59, 59"></Title> 
      </Titles> 
      <Legends> 
        <Legend Alignment="Center"></Legend> 
      </Legends> 
    </Chart> 
  </presentationdescription> 
  <isdefault>false</isdefault> 
</visualization>

The 1st change I made was to to rename the Chart.  This is an optional step and you can change this later during or after import but I like to do this:image

The 2nd change is to the Fetch XML query that collects the data for the Chart.  The Actual Value Bar Chart only fetches the actualvalue attribute so we need to add here the estimatedvalue attribute.  Now, if we go and open the “Estimated Value Line Chart” that we exported we can copy this line from there.  But we need to make sure each Attribute specified here has a unique alias so if you do this just adjust the alias to something else:

image

The 3rd change is to add a second measurecollection to the definition.  This tells CRM that we want another data series presented on the Chart and instructs CRM which attribute from the Fetch XML query provides the data value:

image

The 4th change is to the Series definition.  Here we copy and paste across the Series definition from the “Estimated Value Line Chart”.  I also make 2 additional cosmetic changes which are optional but which improve the readability of the visualisation once rendered:

  • Change the colour of the “Estimated Value Line Chart” series to “255, 0, 0” to switch to a red line
  • Change the IsValueShownAsLabel property of the “Actual Revenue Column Chart” series to “False” to hide the data point values that appear above each bar.
    image

That’s it.   Final steps are to Save the updated XML file and then re-import it back into CRM.

Note: As you import it CRM will recognise that the XML definition originated from an existing Chart and will give you the option to overwrite the existing definition or add a new Chart.

Here’s the end result:

image

There’s more you can do to improve the appearance of the end result but these steps should give you nice simple replicable steps to get to this point quickly.

Now, to create the Stacked Column Chart the steps are much easier.  To demonstrate this let’s grab the exported “Actual Revenue Column Chart” XML that we have not modified.   The change is a simple one, all we need to do is:

  • Rename the Chart (if you want to)
  • Add an additional attribute grouping (make sure it has a unique alias)
  • Change the ChartType to “StackedColumn” (note: data series are presented as Bar charts by default if no ChartType is specified in the series.  If your starting point is a Bar Chart you will need to add ChartType to the Series definition, otherwise you can just edit it)

image

That’s it.  Save and import and you will get:

image

Update:  I has to create a stacked chart today so came back to this blog.  This time around my stacked chart turned out a little ugly, with this weird gradient fill:

image

Now I’m not sure whether I experienced this back when I wrote the above post and forgot to document how to fix it or whether things have changed.  Anyway here’s how to ditch the gradient fill, simple delete the following from your chart XML:

image

I also had a new requirement.  I was now dealing in high values and need to applying some formatting to my labels.  I got the answer from this post.    Here’s what I added to have my series labels show in millions:

image

I think the way to read that format string (from left to right) is:   “I want…

– A “$” sign at the front

– The numerals to the left of the million separator to show

– The numerals to the right of the million separator not to show

– The numerals to the right of the thousand separator not to show

– An “m” at the end”

 

Here’s the end result:

image