JavaScript Upgrade Gotcha #2: Using the JavaScript eval method

The use of the JavaScript method eval is considered to be bad coding practice by most of the JavaScript Technorati. That doesn’t stop people from using it, and it makes automatic conversion verify difficult. Consider this code:

 

this.FieldName1 = "name";

eval('this.Field1 = crmForm.all.' + this.FieldName1);

 

While I will not debate the merits of this code, which seems pretty useless to me, I will tell you I can’t convert this automatically.  So again, this is a manual correction is required.

 

Need help with your JavaScript upgrade to Dynamics CRM 2011 and 2013?

See what Transformer! for Dynamics CRM can do for you.

Leave a Reply