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

Announcements

No record found.

News and Announcements icon
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

    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

    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

    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

    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

    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 81 Super User 2026 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

#3
11manish Profile Picture

11manish 62

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans