Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

The maximum read depth (32) has been exceeded error when insert entity record - CRM SDK

Posted on by 10

I have a Web API project which exposes list of post APIs. These APIs insert into some Dynamics 365 CRM (V9.1.11.26) entities. I have more than 30 entities all works fine. Except one entity, when I try inserting new record (organizationServiceproxed.Create(entity)), I always get this error:

The maximum read depth (32) has been exceeded because XML data being read has more levels of nesting than is allowed by the quota. This quota may be increased by changing the MaxDepth property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 79, position 5267.

InnerException is null

This entity has on create workflow, so I think there is some validation error is thrown but somehow it is not returned to the exception.

I searched this error and I found out that this error is WCF related error to the maxDepth configuration. So how to configure this option in Dynamics CRM or how to fix this error.

pastedimage1675023723613v1.png

I checked the event viewer, CRM traces and no errors. 

  • Pradeep Rai Profile Picture
    Pradeep Rai 5,490 Super User 2024 Season 2 on at
    RE: The maximum read depth (32) has been exceeded error when insert entity record - CRM SDK

    Sorry. I thought you have a WEBAPI project from there you are inserting data into CRM. I have never seen this type of setting in dynamic crm.

  • MahmoudGamal Profile Picture
    MahmoudGamal 10 on at
    RE: The maximum read depth (32) has been exceeded error when insert entity record - CRM SDK

    One record only. No records were retrived. This is not a table, this is dynamics crm 365 entity. I am calling end point from CRM, I think there is an error or infinite loop in the end point I am calling. I am asking how to maximize this configuration to show the complete error.

  • Suggested answer
    Pradeep Rai Profile Picture
    Pradeep Rai 5,490 Super User 2024 Season 2 on at
    RE: The maximum read depth (32) has been exceeded error when insert entity record - CRM SDK

    How many records your inserting in one way go?

    Also, before insert are you retrieving any records from that table? if yes then try to reduce the in clause condition of fetchXML.


  • MahmoudGamal Profile Picture
    MahmoudGamal 10 on at
    RE: The maximum read depth (32) has been exceeded error when insert entity record - CRM SDK

    Thanks for the reply, I found a lot of answers like this, but where to put these configuration in Dynamics CRM?!

  • Suggested answer
    Pradeep Rai Profile Picture
    Pradeep Rai 5,490 Super User 2024 Season 2 on at
    RE: The maximum read depth (32) has been exceeded error when insert entity record - CRM SDK

    Hi,

    Please check below option in your WCF project.

    https://www.codeproject.com/Questions/1248313/Max-read-depth-issue-when-sending-objects-to-WCF-s

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans