
Are javascript prototype functions supported in CRM2016 ver 8.1 on prem?
For example String.prototype.dosomething().
They do work as expected, however I am experiencing a lead conversion bug that does not happen when removing the prototypes script.
*This post is locked for comments
I have the same question (0)Hi AbaxisBob,
Does this research from another developer (and challenges they had) help answer your question? This is from here: http://gonzaloruizcrm.blogspot.com/2013/01/script-scriptsharp-and-crm-good-and-bad.html
3. AJAX incompatibility. I noticed that my dates in the form were not getting formatted as per the CRM user settings and some other fields and controls had strange issues (e.g. missing the month from the calendar control). After some investigation the culprit ended up being Script#. The reason: mscorlib.js defines classes and functions such as Date.prototype.format and Date.prototype.localeFormat. These functions are also defined in the AJAX framework that the CRM application uses in global.ashx and guess what: They are not implemented the same way. Because the CRM application relies on the MicrosoftAjax.js implementation it will be buggy if it uses the mscorlib.js implementation. Unfortunately, as soon as you add mscorlib.js library to your form, it will overwrite the functions from global.ashx and there is no way to “force” the CRM application to use the functions defined in global.ashx instead. I had to implement an emergency workaround to fix this problem which consisted in adding another JS library to the form, which would define the functions back with the AJAX implementation (something like overwriting the overwrite). Ugly, but it fixed the problem.
Thanks much,