none
Dynamic CRM Retrive Contact from Biztalk 2013

    Question

  • I would like to retrive Dynamic CRM 2011 contact detail from Biztalk 2013. How could I achieve this?

    Which schema I need to use to retrieve contact details?

    I have downloaded following schemas but not getting Retrive entity frm these.

    OrganizationService_schemas_microsoft_com_crm_2011_Contracts.xsd

    OrganizationService_schemas_datacontract_org_2004_07_System_Collections_Generic.xsd

    I have decided to use WCF end point of Dynamic CRM 2011. Is there a better way?

    Please help.

    Regards,

    Pabitra


    Hello

    Friday, September 06, 2013 9:35 AM

Answers

All replies

  • I found Retrive in following schema.

    OrganizationService_schemas_microsoft_com_xrm_2011_Contracts_Services.xsd


    Hello

    Friday, September 06, 2013 9:59 AM
  • If you want to use FetchXML then you can use the RetrieveMultiple and parse the responses.

    Regards.

    Friday, September 06, 2013 11:25 AM
  • I would like to pass contact id and would like to know the contact exists or not.

    Hello

    Friday, September 06, 2013 11:28 AM
  • I have already gone through this article but it is not that detailed one.


    Hello,

    In case of Retrieve how would I map contact id of to employee id of Dynamic CRM entity? Can I do it through scripting functoid using inline XSLT? The map is follows.

    How can I map to 'string' element of 'Columns' node?

    • Edited by Pabitra Dash Saturday, September 07, 2013 6:23 AM
    Friday, September 06, 2013 1:39 PM
  • You cannot map it unless your employee-id's are GUID's (because that is what the contact id in CRM is).

    So you will have to use a FetchXML (select * from contacts WHERE contact.employee_id = "") and use the RetrieveMultiple to get the contact record. The response will contain the GUID or contactid.

    Regards.

    Saturday, September 07, 2013 6:28 AM
  • Thanks for your answer. In fact in the given above map, I would like to map 'id' to any of CRM field lets say 'managername'(text field).  If found then I would like to do further processing. How would I do that?

    Regards,

    Pabitra


    Hello

    Saturday, September 07, 2013 6:54 AM
  • To be frank, for all my Dynamics CRM integration I have found MAPS to be very cumbersome. I have done most of it through helper classes. I find this easier because the CRM schemas are generic schemas and depending on the way the attributes are defined in CRM on the entity, additional values, xsi:types, even sub elements need to be constructed.

    So in your case manager name might be a text field but in the case or CRM, it may be an entity reference (lookup). In which case you'd have to first query contacts to get the contactid associated with the manager name and then add it to the contact as an entity reference using the contactid.

    Regards.

    Saturday, September 07, 2013 7:52 AM
  • In my case I just need to compare a custom field which would be added later. For now I would just compare it to any field like 'managername' of type string for testing then do further processing like adding a email activity to CRM. How could I do that?

    Hello



    • Edited by Pabitra Dash Saturday, September 07, 2013 8:46 AM
    Saturday, September 07, 2013 8:01 AM
  • Hello Shankycheil,

    You are right I would like to query first then create some other entity. How could I do it. Please comment.

    Regards,


    Hello

    Saturday, September 07, 2013 8:51 AM
  • So you need to create a FetchXML, this is easily done using the CRM front-end. You can then parameterise this and store it as a resource string in your helper class. You then need to create the request schema instance for "RetrieveMultiple". One of the parameters that can be passed to this is the FetchXML query. So in the CRM schemas you promote the FetchXML (which is a string value where you can stuff the entire FetchXML).

    Now in the helper class you create two methods, ONE which return the "RetrieveMultiple" instance XML as a string and the other to return the parameterised FetchXML. Then in your orchestration, create a message of the CRMRetrieveMultiple Request type. In the message construct, you will use the first helper to assign the base message. Then because of the property promtion the "Query" field will get promoted to which you'll assign the OuterXml of the parameterised FetchXML. The call to CRM will return the results from which using XPATH you can retrieve the GUID (contact id). This can then be used (EntityReference) in other CRM calls such as Create, Update, etc.

    Regards.

    Saturday, September 07, 2013 9:10 AM
  • I created a FetchXML. Do I need to store it in resource string and access through heclper C# class through a method?

    Due to some constraint(project dependency) I can not create message type CRMRetrieveMultiple in Orchstration. I need to do it through mapper. Do you know any sample link in which RetriveMultiple and RetriveMultipleResponse are used?

    I think I need to pass FetchXML Query to RetriveMultiple desination schema through a script functoid. Please help.

    Regards,

    Pabitra


    Hello

    Saturday, September 07, 2013 12:51 PM
  • I think the following link would be useful.

    http://www.codeproject.com/Tips/604434/Retrieve-Multiple-Dynamics-CRM


    Hello

    Saturday, September 07, 2013 1:16 PM
  • HI,

    It seems that your issue has been resolved according to the sample  http://www.codeproject.com/Tips/604434/Retrieve-Multiple-Dynamics-CRM . And I will mark it as answers. If you have any questions in future, you can unmark it and continue to ask.

    Thanks.


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED> Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue.It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Wednesday, September 25, 2013 2:24 AM