none
BizTalk - CRM 2011 Integration Lookup Entity

    Question

  • Hi,

    Any idea what is wrong with this Create XML for lookup?

    The Record is inserted in the Entity if I dont have any lookups. Rest all other types works fine(Options).

    I am trying to create a record in the Entity lucky_accountbylistvalidationrel which has an Attribute lucky_accountsbylistid which is lookup to another Entity lucky_loadlist.  The ttribute does exist in the Entity.

    <ns0:Create xmlns:ns2="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:ns0="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:ns3="http://schemas.microsoft.com/xrm/2011/Metadata" xmlns:ns5="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:ns1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" xmlns:ns4="http://schemas.microsoft.com/xrm/2011/Contracts">
    <ns0:entity>
    <ns4:Attributes>
    <ns4:KeyValuePairOfstringanyType>
    <key xmlns="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
    lucky_accountsbylistid
    </key>
    <value xsi:type="a:EntityReference" xmlns="http://schemas.datacontract.org/2004/07/System.Collections.Generic" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts">
    <Id xsi:type="ser:guid" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/">
    4B4B105F-6B82-E111-A667-00155D067401
    </Id>
    <LogicalName xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
    lucky_loadlist
    </LogicalName>
    <Name xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" ></Name>
    </value>
    </ns4:KeyValuePairOfstringanyType>
    </ns4:Attributes>
    <ns4:LogicalName>lucky_accountbylistvalidationrel</ns4:LogicalName></ns0:entity></ns0:Create>

    Error XML:

    <?xml version="1.0"?>

    -<Fault xmlns="http://www.w3.org/2003/05/soap-envelope">-<Code><Value>Sender</Value></Code>-<Reason><Text xml:lang="en-US">'lucky_accountbylistvalidationrel' entity doesn't contain attribute with Name = ' lucky_accountsbylistid '.</Text></Reason>-<Detail>-<OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><ErrorCode>-2147217149</ErrorCode><ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic"/><Message>'lucky_accountbylistvalidationrel' entity doesn't contain attribute with Name = ' lucky_accountsbylistid '.</Message><Timestamp>2012-04-15T12:36:39.1553076Z</Timestamp><InnerFault i:nil="true"/><TraceText i:nil="true"/></OrganizationServiceFault></Detail></Fault>


    Regards, NISHIL. MCT,MCTS BizTalk Server,MS BI. Http://www.KnishTech.com Http://www.BiztalkForums.com .Chat with Nishil now! NishilJain @ hotmail,gmail,Yahoo


    • Edited by Nishil Jain Sunday, April 15, 2012 2:43 PM Biztalk in Google search
    Sunday, April 15, 2012 1:17 PM

Answers

  • Thanks a lot for thinking on it. I found the solution ;) .

    Short story this XML mentioned below works fine against CRM.

    The lookup code on Richard Soretor WebSite doesnot work but thanks Richard you did a great job by writing this blog post.

    http://seroter.wordpress.com/2011/05/20/creating-complex-records-in-dynamics-crm-2011-from-biztalk-server-2010/

    I have posted one on the Lookup so nobody wastes 2-3 days like me on this issue.

    http://biztalkconnect.blogspot.com/2012/04/crm-2011-attribute-lookup-integrating.html


    <ns0:Create xmlns:ns2="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:ns0="http://schemas.microsoft.com/xrm/2011/Contracts/Services" 

    xmlns:ns3="http://schemas.microsoft.com/xrm/2011/Metadata" xmlns:ns5="http://schemas.microsoft.com/2003/10/Serialization/" 
    xmlns:ns1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" xmlns:ns4="http://schemas.microsoft.com/xrm/2011/Contracts">
    <ns0:entity><ns4:Attributes><ns4:KeyValuePairOfstringanyType>
    <ns1:key>lucky_accountsbylistid</ns1:key>
    <value xsi:type="a:EntityReference" xmlns="http://schemas.datacontract.org/2004/07/System.Collections.Generic" xmlns:xs="http://www.w3.org/2001/XMLSchema" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts">
    <a:Id xsi:type="ser:guid"  xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/">
    4B4B105F-6B82-E111-A667-00155D067401</a:Id><a:LogicalName>lucky_loadlist</a:LogicalName>
    <a:Name />
    </value></ns4:KeyValuePairOfstringanyType>
    </ns4:Attributes><ns4:LogicalName>lucky_accountbylistvalidationrel</ns4:LogicalName></ns0:entity></ns0:Create>


    Regards, NISHIL. MCT,MCTS BizTalk Server,MS BI. Http://www.KnishTech.com Http://www.BiztalkForums.com .Chat with Nishil now! NishilJain @ hotmail,gmail,Yahoo

    • Marked as answer by Nishil Jain Sunday, April 15, 2012 8:45 PM
    Sunday, April 15, 2012 8:45 PM