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 well...it fails.  I had also posted over msdn forum for help but nothing came up.
http://social.msdn.microsoft.com/Forums/en-US/biztalkgeneral/thread/3b08958a-cd8e-480d-9b35-eccbdfca04f8/#3b08958a-cd8e-480d-9b35-eccbdfca04f8

But this German link helped me a lot. I had to translate it to English but it was worth every penny.
http://www.msdynamics.de/viewtopic.php?f=60&t=12408

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.
http://seroter.wordpress.com/2011/02/10/the-good-bad-and-ugly-of-integrating-dynamics-crm-2011-and-biztalk-server-2010/

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!

13 comments:

  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??

    ReplyDelete
  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:


    ProductPrice

    250320.01

    ReplyDelete
  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

    ReplyDelete
  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?

    ReplyDelete
    Replies
    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.

      Delete
  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

    ReplyDelete
    Replies
    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.

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

    http://www.sjsoftech.com/index.php/products/biztalkadapters/dynamicscrmadapter

    ReplyDelete
  7. Hi, Can you please help me to resolve this issue
    http://social.msdn.microsoft.com/Forums/en-US/d07394ea-0c79-418c-946a-4ce4954f34ad/create-records-in-messaging-entity-from-biztalk?forum=biztalkgeneral

    ReplyDelete
  8. Having QuickBooks error 6000 83 while opening a company file? Beware, if the same error continuously occur you may suffer from data loss, and that too unrecoverable. If you want to resolve the error then hit the link above and learn more about the error and ways to resolve.

    ReplyDelete