As described in the title, today I had to fix a pretty strange error that was appearing on two Lookups whenever I tried to change their values in the form. Basically, after clicking on any of these two fields, CRM was throwing the next error:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=126.96.36.199, Culture=neutral,
PublicKeyToken=31bf3856ad364e35]]: System.Xml.XmlException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #D7E22C20Detail:
<ErrorDetails xmlns:d2p1=”” />
<Message>System.Xml.XmlException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #D7E22C20</Message>
<InnerFault i:nil=”true” />
<TraceText i:nil=”true” />
One of the biggest problems I faced while trying to fix this issue was that the error above was not specifying anything. At the beginning, I thought that this error was related to a Script, Plugin, Workflow or Business rule. However, after disabling every single customization attached to this entity, I noticed that it was still appearing. I did research over different blogs and this error was very hard to fix, some said that it was related to the browser and others that they had to delete and re add the field to fix it, this of course was not a solution for me so I had to try other workarounds that didn’t either.
After digging on how this Lookup field was populated, I came across that all records in this entity were created by an external integration and many of them had issues due to this. So, the problem was related directly to the data itself and not to any customization. To fix the issue, we had to remove some special characters that the records had, once we did this, the error didn’t appear anymore.
Hope it helps.