Sunday, April 15, 2012

CRM 2011 Attribute Lookup: Integrating BizTalk with CRM 2011

Hi Friends,
I have been working on a CRM 2011 Integration using WCF Adapter from BizTalk. Richard Seroter has done a very good job by posting 2 Articles on it which clears most of the basics.
Past few days I have been struggling to get this Lookup thing right. I tried the solution which Richard mentioned but seems he dint test it fails.  I had also posted over msdn forum for help but nothing came up.

But this German link helped me a lot. I had to translate it to English but it was worth every penny.

So what was the solution?
I had 2 Script functoids as shown in the map below as Richard has in the basic one first Series of CRM Integration.

The C# Script in Functoid1 returns the name of the Key(Attribute Name) which is simple.

The important thing is mapping the value field where we lookup the other Entity which is shown as below

The Script is as below.

This XML works fine against CRM
LogicalName is always the name of the Entity.

So if you would like to work with CRM lookup its easy but hardly any resources online and strangely nothing from Microsoft on documentation regarding Integrating CRM 2011 with BizTalk.
I wasted good enough days banging my head to make this lookup work but its all is worth when you see it working finally.
Just mail me if you have any questions regarding Integration CRM 2011 using WCF Adapter in Biztalk.
Finally thanks Richard for post such valuable content regarding Integrating CRM 2011 using WCF BizTalk Adapter.

Hope this post helps you all!


  1. Hi Nishil

    the post has helped me a lot, but right now i have an issue becuause my data type to sendo to crm is of currency type, how could be the template for this type??

  2. Hello everybody,

    for Money Type, you can use the same in option set values,it's the same but the xs:type that must be "a:Money".

    An Example:



  3. Hello everybody

    Anyone of you could send a retreivemultiple query to CRM? this in order to get the GUID of the register that i'm looking for

  4. Good to hear that you’ve found a solution for the Lookup problem. And from the looks of it, the outcome is actually impressive. Lookup is an essential tool for CRM programs because it is used to view customer information, contact, related documents, and transaction details in the database. Anyway, are the scripts compatible with other CRM programs other than the CRM 2011 with BizTalk?

    1. Jamie,
      Thansk for the comments.
      This solution is particular to CRM 2011 Webservice.
      But it should be similar as every product supports Webserivces of some sort to query their systems.

  5. Integrating the two is certainly a good idea for building a relationship-based solution thru CRM for a wide Biztalk network. It would really make the solution more flexible and easier to use. But, the downside is that adding a WCF service reference to a .NET app like CRM doesn’t always work. Good thing you found a solution for it. But what would happen if one of the software gets updated and the others don’t? Maybe it’s better if we just wait for a partner solution to make the integration a tad simpler.

    @Darcy Grubaugh

    1. Darcy,
      Microsoft products always go hand in hand. For example with new release of SQL 2012 there is plan for BizTalk 2013.
      Till the time CRM Webservice remains the same in next version of CRM...this solution will work fine.

      The point of using BizTalk is to have loosely coupled Integrations and not to be tightly bounded to any product.

  6. Check the below link for new CRM 2011 BizTalk Adapter. It is easy to integrate to MS CRM using this BizTalk adapter.

  7. Hi, Can you please help me to resolve this issue