Friday, June 28, 2013

SSRS Prefiltering for Microsoft Dynamics CRM 2011 On-Premise in a Snap, The Simple Scenario That Most People Want.

I feel like I had to poke around way too hard to get the easy answer of how to prefilter SSRS reports the way I see it in the system.  This example uses SQL-Based FetchXML based reporting on CRM 2011 On-Premise

This allows you to:

  • Run a report on just the record you are in from the entity form
  • Run the report from a view on just the records in the view or just selected records within that view
  • Run Advanced Find style filtering on your report if just ran from the reports section.
There are two steps:

1. You need to modify your query to include a specific prefixed alias.  This signals CRM to pass in the context of the records and filtering to apply by parsing in a subquery.

An example query without pre-filtering:

SELECT accountid, name FROM FilteredAccount

The same query with pre-filtering enabled:

SELECT accountid, name FROM FilteredAccount AS CRMAF_FilteredAccount

So that's all you need to do at the report level to enable pre-filtering

2. When uploading the report, you need to choose the "Related Record Types"  and add Forms for related record types, lists for related record types to the "Display In"  section.

-I hope this helps!

Wednesday, June 26, 2013

Connecting to CRM 2011 Through iOS (initial thoughts)

There is a good chance that in the near future I am going to have to start writing some CRM 2011 connection stuff for iOS.  Also, someone on LinkedIn asked me today what my thoughts were.

Some initial ideas:

I don't write much Objective-C. We use Xamarin quite a bit at RBA, which allows us to write most of the app once (in C#) and then just re-write the UI layer for iOS or Android.

For the connection you can do a couple of different things. Depending on what the app is for, you can create a SOAP-based .NET web service to broker the connection and pass data back and forth, otherwise you can usually use something similiar to a SOAP-only client like the one that is here: (again, this will only work if your underlying app is still C#)

Here's some other great general information and links on non-.NET client development.

Tuesday, June 11, 2013

Format of Jscript SOAP Responses in Microsoft Dynamics CRM 2011 Organization Service has Changed in UR 12!

You used to be able to pass in your response.responseXML.xml into a function like the one below to parse out a response and pull individual attributes.

function parseResponse(responseXML, attributename) {

    xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
    for (i=0;i<x.length;i++)
      if (x[i].childNodes[0].text == attributename)
         //we decode the base 64 contents and alert the HTML of the Iframe

PROBLEM:  With UR 12 and above you can still use this type of function but the responseXML property no longer exists on the response object.

SOLUTION: now instead of passing in your myresponse.responseXML.xml property of your response, now the property of your reponse is just in a  new response property, so the new syntax would just be myresponse.response

I hope this helps!!