CRM 2011 – Form loading error – don’t panic, publish again

I had a terrible moment today when one of my forms wasn’t loading and was throwing an error every time I tried to open the form.

It didn’t matter if I was opening the form, editing the form, it just fell over straight away.  It seemed somehow I had corrupted my form.  Nightmare scenarios were running through my mind, would I have to create the whole form and variables from scratch, I could  probably export the changes and import them with a few changes to create a similar entity but it would probably have the same problem?

after the initial panic, I calmed down and thought what did I change last.

The last change I had mad was a minor one, adding a whole number field and adding it to the form.  This got my thinking that surely that wasn’t the cause.

I took the field off the form published it and then hey presto I could open the form again.  I then added the field back onto the form, published it and I could still open the form.

I’m guessing there had been some sort of problem which occurred last time I was publishing the customizations for this form.  I think for some reason the publishing of the form hadn’t finished or got it’s self in a bit of a mess ( I had never seen this error before).  I think by publishing it again it sorted its self out.

If this problem happens to you, don’t panic and do the following

  • try saving and publishing the customizations for the form again
  • make sure you don’t have multiple windows changing the same variables open
  • remove the last field you added or roll back the last change

Make sure you export your customizations on a frequent basis so if you do have to go back you have a fairly new version to work with

Here is the error, I managed to do it again.  The one thing I noticed was this error occurred when I was deleting a variable and adding a variable with the same name but a different type e.g. it was a whole number and next time is was a string.

Microsoft CRM Error Report:
Error Description:

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.

Full Stack:

[NullReferenceException: Object reference not set to an instance of an object.]
   at Microsoft.Crm.Application.Forms.CustomizableFormExtended.BuildFormModel(FormDescriptor formDescriptor)
   at Microsoft.Crm.Application.Forms.CustomizableForm.Execute(Entity entity, FormDescriptor fd)
   at Microsoft.Crm.Application.Components.Utility.GenericEventProcessor.RaiseEvent(String eventName)
   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)

[HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown.]
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Other Message:
Error Number:
Source File:

Not available

Line Number:

Not available


6 thoughts on “CRM 2011 – Form loading error – don’t panic, publish again

  1. Ben L December 7, 2012 / 11:45 pm

    A week before we go production, I almost went ballistic because of this exact issue. This saved me hours. Thank you much.

    Like

  2. na December 31, 2013 / 6:33 am

    not understood

    Like

  3. Ankita September 22, 2014 / 10:19 am

    Thank you very much.

    Like

  4. scottmyersliazon June 10, 2015 / 6:09 pm

    HOW do you “roll back” your last changes? The changes saves but lock up async upon publishing

    Like

  5. nicolailang August 26, 2015 / 7:58 am

    I’v been known to forget to publish the entity when adding newly created fields to a form. But afair the error I get actually says it can’t find the field so it’s easier to discover.

    Like

  6. ponyo358 February 16, 2017 / 10:44 am

    I recommend the bulk form attribute manager from XRMToolBox for these kinds of problems. I has certainly helped me before. Sometimes, you are allowed to make changes which break the form and lock you out of not only your form but also the entity instances. There’s no way to fix this within the CRM that I know of, unless you go ahead with a backup and lose a day. The above tool can spare you that.

    Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.