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:|
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.
Exception of type 'System.Web.HttpUnhandledException' was thrown.
[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)