I'm tracking down and trying to fix a number of javascript errors that have appeared after we performed a move to CRM 2016. JavaScript I'm comfortable with, but I do not know anything about CRM. Some of the errors were simple to fix and all I had to do was change "document.getElement..." to "parent.document.getElement...".
However, there are a number of errors that are of the type 'Cannot read property '_behaviors' (shown below) that are being stubborn and I'd appreciate any help in finding their solution. Thanks.
---------------------------------- Code ----------------------------
parent.document.getElementById("old_something_i")._behaviors[0].AddParam("disable", "1");
--------------------------------------------------------------------
---------------------------------Error-----------------------------------------
TypeError: Cannot read property '_behaviors' of null
at NameOfJavascriptMethodAppearsHere (xxxxx/.../new_thisIsTheNameofMyScript)
at eval (eval at RunHandlerInternal (xxxxxxx/.../ClientApiWrapper.aspx), <anonymous>:1:1)
at RunHandlerInternal (xxxxxxx/.../ClientApiWrapper.aspx)
at RunHandlers (xxxxxxx/.../ClientApiWrapper.aspx)
at OnScriptTagLoaded (xxxxxxxx/.../ClientApiWrapper.aspx)
at http://xxxxxxx/xxxxxx/form/ClientApiWrapper.aspx?ver=1106676978:201:1
------------------------------------------------------------------------------------------------------