While working on a Microsoft Dynamics CRM 4.0 to CRM 2011 upgrade we encountered this error while trying to customize the CRM 2011 entity form:


Error: Exception of type ‘System.Web.HttpUnhandledException’ was thrown.

Error Message: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Error Details: Exception of type ‘System.Web.HttpUnhandledException’ was thrown.

Source File: Not available

Line Number: Not available

Request URL: http://servername/orgname/tools/formEditor/formeditor.aspx?action= &formtype=main&objectTypeCode=3&pagemode=iframe&sitemappath=Workplace%7cMyWork%7cnav_dashboards

Stack Trace Info: [NullReferenceException: Object reference not set to an instance of an object.]

at Microsoft.Crm.Application.Controls.FormEditorBase.AddPlaceHoldersInSection(XmlNode& secNode)

at Microsoft.Crm.Application.Controls.FormEditorBase.AddSpacerCellsInSectionIfRequired(XmlNode& secNode)

at Microsoft.Crm.Application.Controls.FormEditorBase.AddColumnsAttribute(XmlNodeList& nodeList)

at Microsoft.Crm.Application.Controls.FormEditorBase.ValidateFormXml()

at Microsoft.Crm.Web.Tools.Views.FormEditorPage.ValidateFormXml()

at Microsoft.Crm.Web.Tools.Views.FormEditorPage.GetFormXml(String formXmlString)

at Microsoft.Crm.Web.Tools.Views.FormEditorPage.ConfigurePage()

at Microsoft.Crm.Application.Controls.PageManager.OnPreRender(EventArgs e)

at System.Web.UI.Control.PreRenderRecursiveInternal()

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Fortunately, Microsoft seems to have already encountered this issue, we found this post on the MSDN blogs:

In this post we will expand on Microsoft’s post to make it easier for the CRM community to understand.

Disclaimer: This article describes manually editing the configuration file for CRM. Making mistakes here can have devastating effects on your CRM system and is considered advanced work. Be sure to save a copy of your original export file in a safe place before making any changes to the XML. If this kind of work makes you feel queasy, ask for help from someone who is more technical.

The problem is a discrepancy between the rowspan attribute on the cell tag and corresponding row tags in customizations.xml.

Let’s look at the XML for the Description field on our Opportunity Form

CRM 2011 Error Customizing Entity Form

Notice how the value of rowspan (5) matches the number of row tags in the XML? This is good XML.

Now since I like you all so much, I am going to break my XML to show what happens. Let’s take one of those <row></row> tags out, save the file, compress it, import it into our CRM system and Publish.

When I try to customize the main Opportunity form here’s what I get:

If you don’t have development errors enabled, you’ll just see this, but I would get the error above if I were tracing this error.

To fix this problem we need to get the customizations.xml for the entity that is giving you trouble. Go to Settings, Customizations, Solutions. Create a new, unmanaged solution and add the entity that is producing the error. You will not need to include required components; in fact, you’ll be glad that you didn’t. Export the solution, extract the files and open customizations.xml with a XML text editor.

Now for the tedious part: Perform a search for rowspan= and find the section or sections that contain a rowspan count attribute that is greater than the number of <row> tags for the section. Here’s where not including required components is going to save you time. When you find the section that has fewer row tags than rowspan specifies, just go ahead and add another set of <row></row> tags before the last one. Complete your search for additional rowspan attribute to row tag discrepancies and then reimport the solution to your CRM system. This will fix the error above.

We hope you found our explanation helpful. If you’re encountering this error and would prefer the help of a CRM professional to resolve it, give your CRM super heroes a call!

Happy CRM’ing!

Avatar for Joe D365

Joe D365

Joe D365 is a Microsoft Dynamics 365 superhero who runs on pure Dynamics adrenaline. As the face of PowerObjects, Joe D365’s mission is to reveal innovative ways to use Dynamics 365 and bring the application to more businesses and organizations around the world.