In my Previous Post I created a WebResource of type JScript using jQuery.
After publishing my customization when I ran the activity using the WebResource, I received an Error: ‘$’ is undefined and my process returned false.
The Reason actually is, $ is shorthand for jQuery. And jQuery is not included in CRM-2011, so you’ll have to add a web reference yourself.
To do that kindly follow the below steps:
- First download the latest version of jQuery from its Official Website.
- Then add the newly created jQuery WebResource to your form library.
Note: Kindly move the jQuery Web-Resource before your function library calling it.
If this script is being called from the ‘OnChange’ event of a form control, then there is no need to call any function. Just adding the Webresource Library to the form will automatically load them in the order they appear on the form’s script customization grid.
But, while calling the script from the ribbon you need to specify function name from the Webresource. Since in this case jQuery is a library and you won’t be calling any of its functions, simply use isNaN as the function to call.
After all this done, there will be no such Errors. Hope this was Helpful.