I have received a few questions from one of the readers of this blog and I will answer them bellow:

I am currently working on a project which is planning to use CRM 2011 as a development platform for migrating an existing  vertical specific LOB application.  As the existing application has a large and complicated database, I am trying to better understand how CRM 2011 can use external data, hence the following questions:
          Can CRM 2011 use external data assuming it is exposed as an OData feed?

Yes and no. CRM 2011 cannot using some simple mode of configuration connect to an OData feed but there are numerous customizations that can be done using techniques such as javascript, mash-ups, SilverLight, XSLT or ASP.NET that can be used to work with the Odata feed. When I work with my clients, I usually try to understand what they are trying to achieve to be able to recommend a technique that fits their requirements.

          Will CRM allow creation of Metadata for external Odata?

Yes, as mentioned above the different customization points allow for different ways of communicating and working with external data and metadata such as OData. There are no built in methods that automatically will connect OData to CRM (as I know of anyway).

          Can CRM security model be used for external Odata?

The CRM security model is rather complex as it incorporates several concepts at the same time;

o   Security roles
o   Organizational context with ownership of objects based on this and in conjunction with the roles.
o   Sharing privileges to individual users and/or teams

This results in the fact that it is rather complex to replicate the privileges for a certain object to a related object in another system. It can be done, but requires in-depth knowledge of the CRM security model and the API:s as all data related to this can be accessed from the API.

As an example of the complexity, let’s say that you have users A, B and C. User A belongs to division inner sales, user B to division outer sales and user C to division service. All have the same role that only allows access to the accounts within the same division. The account “Vodaphone” is owned by A and A creates a new team to which he shares the rights to view the account “Vodaphone”. He then adds B to this team while creating it. Some time later he adds C to this team as well and shares read-write access directly to B as well.

This is an example that despite the fact that they all have the same roles would involve a lot of setting access rights in the external system since the adding of team members to teams indirectly sets their rights. It is not impossible to implement but quite complex and does require a considerable amount of effort. For an experienced CRM developer, probably not less than 200 hours.

When discussing issues like this with my clients, I, as I usually do, try to understand their core needs and motives so that I can suggest a good-enough solution that will give them the best bang of the buck.

          Does CRM allow the use of external Odata in native forms or custom Silverlight UI has to be developed?

No. Fields (previously called attributes) are directly connected to the database and there is no support for virtual attributes that will retrieve data from an external source.

Integrations to external systems, using any data source, for instance OData, can of course be created that will transfer data to CRM. Data could for instance be periodically sent or sent when there is an update if the external system allows that kind of triggering.

It is also possible to jack into the retrieve or retrieve multiple events that occur when CRM tries to retrieve data so that CRM could pull data from the external data source when data is retrieved. I would not recommend this though since these events occur a lot and it would probably affect performance badly. It is also supported to fetch data directly from the database views using SQL and that would bypass this logic making this data incorrect. This would also cause some problems with working with CRM offline.

The solution you are hinting at using Silverlight is of course also an option but would be similar to some mash-up integration that could also be created using ASP.NET or javascript.

It would sometimes also be an option to create specific reports in CRM that connect to external data sources and integrate the CRM data with the external data in this manner. This method is preferable when using data warehousing or when there are heavy performance issues, as these reports can be cached and scheduled.

Without knowing more about the specific requirements, I would hence recommend some kind of periodic or live integration that transfers the required data to CRM in read-only fields as this would be most in line with how CRM works and would enable all built in features that CRM has to work with this data. It would also be best from a performance perspective and could be scaled if needed.

          Can external Odata be used in Workflow activities?

Yes, custom workflows activities can be created in all versions of Microsoft Dynamics CRM 2011 except CRM Online where the same logic can be created with some work-around effort using plugins instead. These custom workflow activities are created using the .NET framework typically in C# and can hence easily use any available datasource, like Odata.

On a related front, does CRM allow complicated (i.e. highly normalized and multi-level) data hierarchies to be implemented  natively?  If so, is there a performance penalty?  Would we be better off using this data as an external OData feed or bringing it internal to CRM?

No, CRM does not support some of the more complex OO concepts like interfaces and inheritance. As this is something many of us in the CRM community are looking for and it would also be a great addition to the xRM concept so I am certain it is on Microsoft’s list of features they are trying to implement. How far up, I cannot say.

This is usually not a major issue for me when I work with my clients and I have created very complex verticalizations, for instance for the Telco industry which implement a highly normalized and multi-level information model called SID, in CRM. What you need to do is make it a bit more flat and more concrete which you more or less have to do anyway if you want to make the system usable. It is of course important to be well aware of the simplifications you are making but I do not imagine that any usable system possibly could implement the entire SID information model without simplification and still make the system usable and with any reasonable budget. The abstract class “Party” for instance is just too abstract to be of any real use, but it is of course useful to know that contact, account, competitor, lead, system user etc. do share some information. The implementation would however have benefited from one or two inheritances or interfaces.

If the data should be kept in or outside the system is not easy to answer without deeper knowledge of what you are trying to implement. If you keep it mostly outside, you would have to define a very strict line at which information is kept inside or outside of CRM. Do not, however, underestimate the power of the xRM platform, it is often advantageous to implement large or all parts of the LOB application inside CRM/xRM since you get so much functionality for free when doing this.

In general I would need deeper domain knowledge to be able to give you more direct recommendations and I do not think that this is the forum for that kind of discussion as that requires a dialog and would probably best be done in workshops.

I do like the fact that you sent me these questions as I think they are very relevant when looking at the system from an xRM perspective and put the finger on some of the issues that Microsoft have to improve in the system. If there are other readers out there, if you have questions, please send them to me and I will try to answer them on this blog.

Gustaf Westerlund
CEO, Chief Architect and co-Founder at CRM-konsulterna AB
www.crmkonsulterna.se