Problem with unresponsive lookup field on CRM 2011 form
January 26, 2012 2 Comments
Recently had a minor problem with a form in CRM 2011 which I have resolved while trying to fix something else (isn’t that so often the way?).
Problem description / reproduction steps
I created a custom entity in CRM 2011 to use as a joining entity in a manual N:N relationship. In this scenario it was an “Attendance” record to link a Contact to an Event, and enable the business to track the status of the attendance (tentative, confirmed, attended, cancelled) along with relevant dates etc.
To reduce effort on the user’s part I made the primary “description” field on the record auto-filled based on the event and contact name, using jscript web resources. To observe sensible UI practice, I made sure the lookup fields came at the top of the form, then the description which was a result of those, so it should be obvious to the user what to fill in first, then by the time they get to the name field it is already filled in.
A blank new record form is shown below.
So, what went wrong?
When the user creates a new record, they expect to be able to get on with the job of typing in the fields. Although the Event or Contact was automatically filled in if they created the record from the context of the parent record to make life even easier, this still means that sometimes they needed to fill in one or the other field, and that’s where it got strange.
The Event field is first on the form, and you might naturally expect it to take focus when the form loads, ready for typing. No such luck. Even worse, it was not possible to click in this field and start typing to use recent items or wait for the record name to be resolved. Clicking where the mouse is pointing in the screenshot did nothing; the field behaved almost as if it was disabled. Except the lookup button itself was enabled and the user could click here, do a search and choose a record that way, albeit that takes longer.
Nothing I did or could think of would work, the field simply would not take focus at all. This was using IE9 and CRM Online – all latest stuff, surely that should work best?
So how did I fix it?
As it happens I had another bug with IE9. If I got impatient waiting for a form to load, or realised I had clicked in the wrong place and did not want to load the wrong things, I would usually just close the window before it finished loading. This turns out to be a great way to crash IE9 using CRM – if you close a form before it is fully loaded and rendered, it can kill you whole session, which is far from ideal when you have several windows open, especially in the middle of a batch of customisations.
So I logged that bug on the Connect website. And someone from MS helpfully replied with a possible fix, by changing a registry key for IE9, ironically designed to guard against the browser hanging (well, I guess crashing would tend to avoid a hang…)
So I applied the fix:
Create the following Registry Key Value to disable the Hang Resistance feature:
and I still don’t know if it will stop IE9 crashing quite so much, but it sure has helped my ‘broken’ form to work properly. Now it takes the focus on the correct field when I click on it, and even opens the form with the focus already where it should be.
So I sorted it by trying to fix something else altogether. Typical. What’s the best thing you’ve ever managed to get working without actually knowing how?