web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

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

(0) ShareShare
ReportReport
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. 

I have the same question (0)
  • Suggested answer
    Pradeep Rai Profile Picture
    5,489 Moderator 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

  • MahmoudGamal Profile Picture
    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
    5,489 Moderator 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
    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.

  • Pradeep Rai Profile Picture
    5,489 Moderator 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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 120

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 120 Super User 2025 Season 2

#3
#ManoVerse Profile Picture

#ManoVerse 56

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans