locked
Referencing a partylist through key field RRS feed

  • Question

  • We are making a migration to Microsoft Dynamics CRM through a 3rd party. In order to accomplish it, we are sending all of our requests through the soap endpoint.

    In any operation (create/update...) when we need to reference another entity we do so through a key field (since we don't have the IDs) i,e:

    <c:value i:type="b:EntityReference">
    <b:KeyAttributes xmlns:e="http://schemas.microsoft.com/xrm/7.1/Contracts">
    <e:KeyValuePairOfstringanyType>
    <c:key>accountnumber</c:key>
    <c:value i:type="f:string" xmlns:f="http://www.w3.org/2001/XMLSchema">ABCETJKL</c:value>
    </e:KeyValuePairOfstringanyType>                
    </b:KeyAttributes>
    <b:LogicalName>account</b:LogicalName>
    <b:Name i:nil="true"/>
    <b:RowVersion i:nil="true"/>
    </c:value>

    The problem is that we are trying to perform a createRequest in an entity with a partylist. So far we've only been able to obtain the desired result if we use the id when creating the partylist field, when we try to create it as if it were a reference, that attribute is left blank by CRM :

    ...
    <b:KeyValuePairOfstringanyType>
    <c:key>from</c:key>
    <c:value i:type="b:EntityCollection">
    <b:Entities>
    <b:Entity>
    <b:Attributes>
    <b:KeyValuePairOfstringanyType>
    <c:key>partyid</c:key>
    <c:value i:type="b:EntityReference">
    <b:KeyAttributes xmlns:e="http://schemas.microsoft.com/xrm/7.1/Contracts">
    <e:KeyValuePairOfstringanyType>
    <c:key>accountnumber</c:key>
    <c:value i:type="f:string" xmlns:f="http://www.w3.org/2001/XMLSchema">ABCDEFG</c:value>
    </e:KeyValuePairOfstringanyType>        
    </b:KeyAttributes>
    <b:LogicalName>account</b:LogicalName>
    <b:Name i:nil="true"/>
    <b:RowVersion i:nil="true"/>
    </c:value>
    </b:KeyValuePairOfstringanyType>
    </b:Attributes>
    <b:LogicalName>activityparty</b:LogicalName>
    </b:Entity>
    </b:Entities>
    <b:EntityName>activityparty</b:EntityName>
    </c:value>
    </b:KeyValuePairOfstringanyType>
    ...

    Is it possible to make this connection? To reference a partyList field through a key value instead of the id?

    Monday, July 18, 2016 1:52 PM