While developing a Microsoft Dynamics CRM solution integrated with SharePoint for one of our clients, I would get the following JavaScript error when accessing documents from the Outlook Client:

“An error has occurred in the script on this page.”

“Sys.InvalidOperationException: A control is already associated with the element.”

Sys.InvalidOperationException A control is already associated with the element

After a bit of research I identified the root of the problem.

The error is caused by the debug mode in SharePoint (which I had turned on for development purposes).

To turn off debug mode in the SharePoint site’s web.config, navigate to:

C:inetpubwwwrootwssVirtualDirectoriesyour port number

Change:

<compilation batch=”true” debug=”true”>

To:

<compilation batch=”true” debug=“false”>

Problem solved!

If I could be of further help to you, please contact FMT at (760) 930-6400.

Written by:
Josh Anderson
Senior CRM & SharePoint Consultant
FMT

Posted by: