Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Error response "You should specify a parent contact or account"

Posted on by Microsoft Employee

When sending data to client. we were getting response like below.

"You should specify a parent contact or account"

We have tried even below option. 

<a:KeyValuePairOfstringanyType>
<b:key>primarycontactid</b:key>
<b:value i:type="c:string">1900ec4b-3557-4f72-1512-8ffbb551f12a</b:value>
</a:KeyValuePairOfstringanyType>
<a:LogicalName>incident</a:LogicalName>

But again we are getting same.

Can you please some one help this to short out?

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Error response "You should specify a parent contact or account"

    Hi HIMBAP,

    We are getting one error in adding extra field. 

    The InnerException message was 'Error in line 1 position 10969. Element 'schemas.datacontract.org/.../System.Collections.Generic:value' contains data from a type that maps to the name ':int'. The deserializer has no knowledge of any type that maps to this name. Consider changing the implementation of the ResolveName method on your DataContractResolver to return a non-null value for name 'int' and namespace ''.'. .

    Note: I am getting All integer fields same error. 

    Sample code:

    <a:KeyValuePairOfstringanyType>
    <b:key>yearyouwanttojoin</b:key>
    <b:value i:type="c:int">2018</b:value>
    </a:KeyValuePairOfstringanyType>

     

    What is the exact issue here?

    Thanks in Advance.

  • Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: Error response "You should specify a parent contact or account"

    Glad to know it's working for you, please make sure to close this thread as you got your answers.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Error response "You should specify a parent contact or account"

    Once again thank you very much. Now all are working fine for new account id.

  • Suggested answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: Error response "You should specify a parent contact or account"

    Glad to hear that you are able to resolve primary issue.

    Regarding account error it means the accountid that you are sending is not correct, make sure you are sending correct account id.

    Thanks

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Error response "You should specify a parent contact or account"

    Thanks you very much HIMBAP. Now it is resolved. But we are getting different response like below.

    "Account With Id = 1900ec4b-3557-4f72-1234-8ffbb551f42a Does Not Exist"

    This is because of any invalid customer id or really it is a other issue.

    i have searched on some forum. different kind of solutions like cache issue, etc..

    That's also we tried. but still getting same response like above.

  • Suggested answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: Error response "You should specify a parent contact or account"

    Can you share your complete request, I don't see you are sending customer id under attributes node ??

    See my complete request for your reference:

    <s:Envelope xmlns:s="schemas.xmlsoap.org/.../&quot;>

     <s:Body>

       <Create xmlns="schemas.microsoft.com/.../Services&quot; xmlns:i="www.w3.org/.../XMLSchema-instance&quot;>

         <entity xmlns:a="schemas.microsoft.com/.../Contracts&quot;>

           <a:Attributes xmlns:b="schemas.datacontract.org/.../System.Collections.Generic&quot;>

             <a:KeyValuePairOfstringanyType>

               <b:key>customerid</b:key>

               <b:value i:type="a:EntityReference">

                 <a:Id>e3851c60-b5a9-e711-a950-000d3af08673</a:Id>

                 <a:KeyAttributes xmlns:c="schemas.microsoft.com/.../Contracts&quot; />

                 <a:LogicalName>account</a:LogicalName>

                 <a:Name i:nil="true" />

                 <a:RowVersion i:nil="true" />

               </b:value>

             </a:KeyValuePairOfstringanyType>

             <a:KeyValuePairOfstringanyType>

               <b:key>title</b:key>

               <b:value i:type="c:string" xmlns:c="www.w3.org/.../XMLSchema&quot;>Demo</b:value>

             </a:KeyValuePairOfstringanyType>

           </a:Attributes>

           <a:EntityState i:nil="true" />

           <a:FormattedValues xmlns:b="schemas.datacontract.org/.../System.Collections.Generic&quot; />

           <a:Id>00000000-0000-0000-0000-000000000000</a:Id>

           <a:KeyAttributes xmlns:b="schemas.microsoft.com/.../Contracts&quot; xmlns:c="schemas.datacontract.org/.../System.Collections.Generic&quot; />

           <a:LogicalName>incident</a:LogicalName>

           <a:RelatedEntities xmlns:b="schemas.datacontract.org/.../System.Collections.Generic&quot; />

           <a:RowVersion i:nil="true" />

         </entity>

       </Create>

     </s:Body>

    </s:Envelope>

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Error response "You should specify a parent contact or account"

    Thanks for your quickly response.

    I am using also the below code.But I got also same error like this

    You should specify a parent contact or account.

    My sample code:

    <a:KeyValuePairOfstringanyType>
    <b:key>customerid</b:key>
    <b:value i:type="a:EntityReference">
    <a:Id>1900ec4b-1234-4f72-9190-8ffbb551f42a</a:Id>
    <a:KeyAttributes/>
    <a:LogicalName>account</a:LogicalName>
    <a:Name i:nil="true" />
    <a:RowVersion i:nil="true" />
    </b:value>
    </a:KeyValuePairOfstringanyType>

     
  • Suggested answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: Error response "You should specify a parent contact or account"

    Why are you sending it like a string, it's a reference type so it should be like following:

    <a:KeyValuePairOfstringanyType>

               <b:key>customerid</b:key>

               <b:value i:type="a:EntityReference">

                 <a:Id>e3851c60-b5a9-e711-a950-000d3af08673</a:Id>

                 <a:KeyAttributes xmlns:c="schemas.microsoft.com/.../Contracts&quot; />

                 <a:LogicalName>account</a:LogicalName>

                 <a:Name i:nil="true" />

                 <a:RowVersion i:nil="true" />

               </b:value>

             </a:KeyValuePairOfstringanyType>

    I am using here account.

    I will suggest you to use Soaplogger sample that comes with SDK, you can write you c# code there and it will generate soap request for you.

    Thanks

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Error response "You should specify a parent contact or account"

    I have tried with same you said. Again i am getting same error.

    <a:KeyValuePairOfstringanyType>

                               <b:key>customerid</b:key>

                               <b:value i:type="c:string">1900ec4b-1234-4f72-9190-8ffbb551f42a</b:value>

                           </a:KeyValuePairOfstringanyType>

    Sample code:

    <s:Body>

       <Execute

           xmlns="schemas.microsoft.com/.../Services&quot;

           xmlns:i="www.w3.org/.../XMLSchema-instance&quot;>

           <request i:type="a:CreateRequest"

               xmlns:a="schemas.microsoft.com/.../Contracts&quot;>

               <a:Parameters

                   xmlns:b="schemas.datacontract.org/.../System.Collections.Generic&quot;>

                   <a:KeyValuePairOfstringanyType>

                       <b:key>Target</b:key>

                       <b:value i:type="a:Entity">

                           <a:Attributes>

                               <a:KeyValuePairOfstringanyType>

                                   <b:key>uor_firstname</b:key>

                                   <b:value i:type="c:string">mahes</b:value>

                               </a:KeyValuePairOfstringanyType>

                               <a:KeyValuePairOfstringanyType>

                                   <b:key>uor_lastname</b:key>

                                   <b:value i:type="c:string">tdev</b:value>

                               </a:KeyValuePairOfstringanyType>

                               <a:KeyValuePairOfstringanyType>

                                   <b:key>uor_email</b:key>

                                   <b:value i:type="c:string">mahes@dev1.com</b:value>

                               </a:KeyValuePairOfstringanyType>

                               <a:KeyValuePairOfstringanyType>

                                   <b:key>uor_preferredintake</b:key>

                                   <b:value i:type="a:OptionSetValue">

                                       <a:Value>183240000</a:Value>

                                   </b:value>

                               </a:KeyValuePairOfstringanyType>

                               <a:KeyValuePairOfstringanyType>

                                   <b:key>description</b:key>

                                   <b:value i:type="c:string">tews

    tet

    tete.</b:value>

                               </a:KeyValuePairOfstringanyType>

                               <a:KeyValuePairOfstringanyType>

                                   <b:key>uor_levelofstudies</b:key>

                                   <b:value i:type="a:OptionSetValue">

                                       <a:Value>183240000

    </a:Value>

                                   </b:value>

                               </a:KeyValuePairOfstringanyType>

                           </a:Attributes>

                           <a:EntityState i:nil="true" />

                           <a:FormattedValues />

                           <a:KeyValuePairOfstringanyType>

                               <b:key>customerid</b:key>

                               <b:value i:type="c:string">1900ec4b-1234-4f72-9190-8ffbb551f42a</b:value>

                           </a:KeyValuePairOfstringanyType>

                           <a:LogicalName>incident</a:LogicalName>

                           <a:RelatedEntities />

                       </b:value>

                   </a:KeyValuePairOfstringanyType>

               </a:Parameters>

               <a:RequestId i:nil="true" />

               <a:RequestName>Create</a:RequestName>

           </request>

       </Execute>

    </s:Body>

  • Verified answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: Error response "You should specify a parent contact or account"

    It seems you are creating case (incident) record, which require customerid (it could be contact or account), you can't create case without customerid. Pass it in your request it should work fine.

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans