Sonoma Partners Microsoft CRM and Salesforce Blog

Script Error on Case Form in CRM 2016

Today's post was written by Angel Shishkov, Senior Developer at Sonoma Partners.

We have been doing quite a few upgrades to CRM 2016 lately and running into the occasional error or bug. In this blog post I’d like to share one that took a case with Microsoft Support to track down.

Script Error on the Case Form

We did an in-place upgrade of a 2015 CRM Online org to 2016. During the regression testing, we found a script error appearing on load of the Case form. As with other internal CRM script errors, the error report dialog does not appear until you refresh or navigate away from the page. When you click on Download Log to view the log file, you see one of the two error messages below.

Unable to get property 'getPageData' of undefined or null reference

Unable to get property 'firstChild' of undefined or null reference

In both cases, the Case form functions normally and the user is not affected, except for having to dismiss the error dialog.

Tracking Down a Fix

After spending a bit of time troubleshooting, we determined the error is from internal CRM scripts during the form load, probably related to a field on the form, and it was not caused by one of our custom scripts. We also found that the issue only occurred with Turbo Forms turned on. With “legacy form rendering” enabled, the error went away. We proceeded to open a Microsoft Support case.

Microsoft Support quickly determined it was a Turbo Forms defect related to a hidden control on the Case form. They are currently working on a fix for this issue and I expect it will be out after 2016 Update 1, which is also when the legacy form option is being deprecated.

You can read more about the Turbo Forms update in our other blog post.

Implementing the Workaround

Meanwhile, Microsoft Support provided us with a workaround. They directed us to remove the control from the form XML and the error went away. Here are the steps you need to follow to implement this workaround yourself.

  1. Create a CRM solution and add the Case entity to it. Do not add any of the dependencies. Export the solution as Unmanaged.
  2. Make a copy of this solution file and store it - always good to have a backup.
  3. Unzip the exported solution file and use a text editor like Notepad to open the customizations.xml file.
  4. Search within the file for “CaseResearch_LinkControl”. You should find two occurences of this control.
  5. For each occurrence of “CaseResearch_LinkControl”, select and delete the entire parent row of the control. The entire row XML should look something like this:

  6. Once you have deleted both <row> sections, save the customizations.xml file and add it back into the exported solution zip file.
  7. Import your updated solution zip file back into CRM and publish.
  8. This will resolve the script error, though you may need to clear your browser cache and/or restart your browser.
  9. Microsoft Support did not clarify what this hidden control is used for, but you will have a backup of your original Case form in case you want to put it back after it is fixed.


Topics: Microsoft Dynamics CRM 2016 Microsoft Dynamics CRM Online