web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

ReferenceError: $ is not defined

(0) ShareShare
ReportReport
Posted on by

Hi,

We get the following error when openening different entities (e.g. contact and opportunty).

ReferenceError.jpg

ReferenceError: $ is not defined 

at getSettings (xxxxx.crm.dynamics.com/.../pre_fieldsecuritydynamicshow

at onLoading (xxxxx.crm.dynamics.com/.../pre_fieldsecuritydynamicshow)
at eval (eval at RunHandlerInternal (xxxxx.crm.dynamics.com/.../ClientApiWrapper.aspx:142:32), <anonymous>:1:1)
at RunHandlerInternal (xxxxx.crm.dynamics.com/.../ClientApiWrapper.aspx:142:1)
at RunHandlers (xxxxx.crm.dynamics.com/.../ClientApiWrapper.aspx:101:105)
at OnScriptTagLoaded (xxxxx.crm.dynamics.com/.../ClientApiWrapper.aspx:215:1)
at xxxxx.crm.dynamics.com/.../ClientApiWrapper.aspx:186:1

Is this a know issue? It looks like a jquery error.  

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: ReferenceError: $ is not defined

    you just save my day. :)

  • Community Member Profile Picture
    on at
    RE: ReferenceError: $ is not defined

    This worked too, but for Chromes , it give an a warning   though it still works

  • Community Member Profile Picture
    on at
    RE: ReferenceError: $ is not defined

    Worked for Me , Is better because it works for all browsers including chrome . Thanks

  • Community Member Profile Picture
    on at
    RE: ReferenceError: $ is not defined

    Hi Ben , 

    Your 4 lines of code was a life saver for me. If you do not mind can you please explain waht it does ? I am fairly new to both Js and CRM.

    Thanks

  • Suggested answer
    ADKAW1 Profile Picture
    on at
    RE: ReferenceError: $ is not defined

    Adding 


    if (typeof ($) === 'undefined') {
    $ = parent.$;
    jQuery = parent.jQuery;

    in Dynamics 365 too resolved the issue !

  • Suggested answer
    Aman Kothari Profile Picture
    on at
    RE: ReferenceError: $ is not defined

    Hi,

    You can also use requireJs for Injecting Jquery before your function. e.g.

    //add require js first

    require(['https://code.jquery.com/jquery-2.2.0.min.js'],function(){

    //your code

    })

    Thanks

  • Community Member Profile Picture
    on at
    RE: ReferenceError: $ is not defined

    Hi Ben,

    thank you for your post from 11 Aug 2015 6:08 AM. I placed your code in all my custom codes and now my CRM2016 On Prem works.

    What a releave :-)

    Axel

  • benPWP Profile Picture
    65 on at
    RE: ReferenceError: $ is not defined

    That works, but the legacy form rendering is much slower than the new form rendering, and also that option will be switched off in a future update (see technet.microsoft.com/.../dn531078.aspx).

  • Community Member Profile Picture
    on at
    RE: ReferenceError: $ is not defined

    Hi Ben,

    Setting the "Use legacy form rendering" option to Yes worked for me.

    Thnx

  • Verified answer
    benPWP Profile Picture
    65 on at
    RE: ReferenceError: $ is not defined

    Even better, I discovered that jQuery is actually on the page, but the user-defined scripts are now being loaded in an iframe below where jQuery is loaded. The following is an even better fix:

    if (typeof($) === 'undefined') {
    	$ = parent.$;
    	jQuery = parent.jQuery;
    }


    Regards, Ben

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#3
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans