I'm not sure when it
happened. I was happily going along, doing some configuration work for a new
Dynamics CRM 2013 on premise client, when my test users began experiencing an on_load error when opening contact records.
I had hardly done anything on the contact record... well, full disclosure,
paste, try to bend it to my whim, sometimes successful dabbler. So I figured
I had tweaked something a bit too far and was getting pay back in the form of
an error. When I reviewed the two scripts I had on the contact record, I
realized I didn't have an on_load script on the contact form. So I disabled my
So off to my
favorite search engine where I finally found a few posts, shockingly few, related
to the error I was seeing. Apparently there is a bug that presents sometimes, either in
upgraded organizations or in new 2013 organizations when you import a
managed solution. This causes a Microsoft out of the box script to get attached
to the on_load event, as if a user had attached it to the form in the user
interface as shown here:
I tried finding the
script that the form seemed to be looking for, using some of my hard won F12 skills,
and I was successful! But creating a web resource, adding it to the form,
pasting in the script, calling the function on_load, and adding it to the on_load event did not placate the contact form - the error continued taunting me.
Next I tried creating a solution with the contact entity, exporting it and
looking for the area mentioned in the posts I found, but to be honest I was
having trouble following the post, I needed a few more pictures! Next I exported the contact entity from a fresh, untouched
organization and compared it to the contact entity from the organization where
the error was occurring. I recognized some things but not enough to make any
educated guesses as to a fix. So, I let it rest for a bit.
Fast forward to this week. I finally had time to take a breath and give Microsoft a call. Once
I gave them the play-by-play of my situation, my research and my attempts to fix the issue, they matched me up with a great technician. After reading all the info I had provided, the technician had an easy fix option, as well as a
long, drawn out option. I'll take door number one please Alec! We created a new solution,
added the contact entity only, exported, extracted, opened with Notepad++ and
went on the search for InternalHandler nodes. We found about four nodes with
InternalHandler and number three was the problem child. Somehow the Microsoft
script had gotten associated with on_load.
This is an example
of one that is fine:
enabled="true" passExecutionContext="true" />
This was our problem
Notice the event name="onload" and then the InternalHandlers node. The internal handlers node is the one that is not supposed to be there. Now the Handlers node is supposed to be there, it is a script I added to show how a web resource will look if attached through the user interface to the on_load event.
All we had to do was
comment out the InternalHandlers node, zip back up the files, import and
If you have
commented correctly, only the InternalHandlers node will be green when looking
at it in NotePad++. You may wonder, why not just delete it? Not a good idea. Deleting the code presents a bigger chance for error. This way, if you comment out too much or not enough, all you have to do is remove/update the comment to remedy the "too much" or "too little", rather than trying to scramble to find that piece of code you just obliterated.
Once we made this
change, the contact record loaded without incident and the Microsoft tech and I
decided this had made our weekend. Hope this will make your weekend as well!
For more information about this blog or C5 Insight, please contact us here!
The complementary paper includes over 12 years of research, recent survey results, and CRM turnaround success stories.
This 60-second assessment is designed to evaluate your organization's collaboration readiness.
Learn how you rank compared to organizations typically in years 1 to 5 of implementation - and which areas to focus on to improve.
This is a sandbox solution which can be activated per site collection to allow you to easily collect feedback from users into a custom Feedback list.
Whether you are upgrading to SharePoint Online, 2010, 2013 or the latest 2016, this checklist contains everything you need to know for a successful transition.