locked
will document.getElementById work in ms crm 2013 Javascript? RRS feed

  • Question

  • While migrating the crm 2011 code to 2013 we found the document.getElementById in javascript web resource.Will this code work for 2013 version ? if not please suggest the alternative way.

    Tahnks in Advance.

    Thursday, July 10, 2014 12:03 PM

All replies

  • Hi,

    Although it might work, it's not a supported method, be it CRM 2011 or CRM 2013. Some things have changed which will prevent document.getElementById from working since the CRM 2013 DOM has changed. Things like changing the default lookup field entity and similar things which include grabbing a page element and changing its properties might fail, since in CRM 2013 the Ids have changed (often having a suffix of _i).

    I would suggest migrating to CRM 2013 and checking if they actually work. If they don't you can either modify them keeping document.getElementById or you could probably use the new Xrm methods introduced in 2013. The Cheat Sheet is of great help in this case.


    Admin QuikView Solution for CRM 2013



    Thursday, July 10, 2014 12:11 PM