The official word is:
We do not recommend using jQuery in form scripts and ribbon commands.
Right. And what are we to do with thousands lines of code already relying on that miracle? People insert libraries and keep their fingers crossed or follow the wise ones and encapsulate the instance with jQuery.noConflict() call.
There is an easier way, though. Since CRM uses jQuery itself, you can try doing something as simple as:
if (typeof ($) == 'undefined') { if(!!parent) { $ = parent.$; jQuery = parent.jQuery; } }
Brutal but Works on My CRM™
Note: MSDN warns that “Following Microsoft Dynamics CRM Online 2015 Update 1 … there may not be an instance of jQuery available” but I’m yet to see any evidence of that.
The usual warning: contains small parts, use at your own risk and do not operate boats or heavy machinery.
Or how not to create dependencies that could break…. 😉
When you use TurbForms you will not have the default jquery2 in the onload event for example. The ClientApiWrapper has only Xrm (and Mscrm) and stuff like that.
Speaking of 2016 here btw.
TurboForms are firmly in “heavy machinery” category 🙂
You cannot hide from TurboForms forever, eventually that button for legacy rendering will go away 🙂
Also, if you follow the official links you should get jQuery from other sources, either included in your formscript or with a scriptload or even from CDN
https://msdn.microsoft.com/en-us/library/gg328261.aspx
In a perfect world, there is no need for jQuery in form script. The only place where it belongs is html web resource where jQuery can be loaded as “normal” script. The above is what it is – a hack.
If you know thinking of adding your libraries in the form just before your form script. TurboForms produce race conditions so cannot be sure the libraries are always loaded before you use them.