Patch for Chrome 38 lookup error in Dynamics CRM 2013

With huge thanks to Guido Preite’s blog post on the problem, I have developed a patch for this, and I thought I would share.

The crux of the problem is that the code is trying to access an element of an array, and Chrome 38’s JavaScript implementation provides this element already as a feature of the base language. The fix is to simply use the ‘hasOwnProperty’ method to check to see if the array element we are checking actually belongs the object, or is inherited from the prototype.

Here is the fixed function (fix highlighted in red):

function pushCommandParameter(oParameter) {
    if (aParameters.hasOwnProperty(oParameter.Name) && !IsNull(aParameters[oParameter.Name]))
        aParameters[aParameters[oParameter.Name]] = oParameter;
    else {
        aParameters[oParameter.Name] = aParameters.length;
        aParameters.push(oParameter)
    }
}

Unfortunately this is a private method within another function, so we have to redefine the whole thing. I’ve wrapped this up into a simple JavaScript file which you can include on any form that is affected. If and when Microsoft eventually patch the bug, you can simply remove this file from your form.

You can download the patch script here.

7 Replies to “Patch for Chrome 38 lookup error in Dynamics CRM 2013”

  1. Hi Jon

    I’ve tried implementing your fix on the email form, but it doesn’t seem to work. It actually breaks all lookups on the form?

    We are on 2013 UR 2 on the environment where i tried it.

    I added the JS file to the form and also tried adding the ChromeFix funciton to onload but it doesn’t work.

    Am i missing something?

  2. Security alert says your current settings do not allow this file to be downloaded???? I cant down load anything without being blocked

Leave a Reply

Your email address will not be published. Required fields are marked *