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)

CRM-Online loads jquery when modifying an account and dettachs jquery-ui-functionality

(0) ShareShare
ReportReport
Posted on by 540

Hi together,

we are using jquery-ui-autocomplete for selecting postalcode and cities on account-address-fields. This works fine until Microsoft released the new CRM Online-Release.

In this release (and after activating the new crm-functionality what is done automatically on new organizations) the jquery-ui doesn't work when modifying an existing account but works on a new account. We have traced the loading of the javascripts and saw that CRM loads jQuery 1.7.2 when modifying an existing account. This script is not loaded on a new account.

It seems that this loading (after our own loading of jquery and jquery-ui) dettachs the jquery-ui-functionality from the jquery-framework.

In out case: the function "$().autocomplete" doesn't exist (although the jquery-ui-framework is loaded).

Questions:

. Has anybody from you also detected this strange behaviour?

. Is this implicit loading of the jquery-framework an error in the crm-loading-framework and will this be corrected? When crm loads jquery himself then there will  be always problems with this framework (older crm-jquery-versions, the loading sequence is not garanteed etc.)

. Exists a workaround for this issue?

Thanks for your help

Karl

*This post is locked for comments

I have the same question (0)
  • DDWilli Profile Picture
    579 on at
    RE: CRM-Online loads jquery when modifying an account and dettachs jquery-ui-functionality

    Very helpful thank you!

  • Karl Andenmatten Profile Picture
    540 on at
    RE: CRM-Online loads jquery when modifying an account and dettachs jquery-ui-functionality

    Hi Willi,

    i didn't found a real solution but a (little bit) complicated workaround:

    i have jquery and jquery-ui merged in one script („px_jquery_ui_merged_with_no_conflict_alias.js“), which at the end additionally executes the statement  â€ž$pxjQueryLib = $.noConflict();“.

    This loads the both jquery frameworks and then this frameworks can be used under the name "$pxjQueryLib“ instead of „$“ or „jQuery“.

    And then i have rewritten my library-scripts that they use this alias first if it exists. In this scripts i use the following function instead of directly using '$' :

     function $pxjQ() {

           return typeof ($pxjQueryLib) == "undefined" ? $ : $pxjQueryLib;

       }

    Remark: under certain circumstances it's better to use a function instead of a variable:

    var $pxjQ = typeof ($pxjQueryLib) == "undefined" ? $ : $pxjQueryLib;

    because the function is first evaluated when used (and never on load time).

    Hope this helps you a little bit.

    Regards

    Karl

  • DDWilli Profile Picture
    579 on at
    RE: CRM-Online loads jquery when modifying an account and dettachs jquery-ui-functionality

    Did you ever find a solution Karl? I've run into the same issue.

  • Muhammad Adeel Javaid Profile Picture
    5,580 on at
    RE: CRM-Online loads jquery when modifying an account and dettachs jquery-ui-functionality

    Yes Karl you are absolutely right. I am still pondering on the issue that if you are not carrying on modification type tasks then why JQuery is rendering such an exceptional behavior? Anyhow on further search in the matter I cam across the following post:

    www.packtpub.com/.../removing-unnecessary-jquery-loads

    Though it is not particularly about CRM Online but it helps in understanding this exceprtional behavior. I am looking in to the matter deeply and trying to come out with some thing useful for you.

    Regards

  • Karl Andenmatten Profile Picture
    540 on at
    RE: CRM-Online loads jquery when modifying an account and dettachs jquery-ui-functionality

    Hi Muhammad,

    you are right: this is a border-case.

    But we don't modify the data and don't modify the form/page, we only "extend" the crm functionality.

    I think we would have the same problem when including some html as iFrame.

    But i think that a lot of other developers are doing the same: extend the crm-forms by javascript-functionality, in our case by using the javascript-framework jquery-ui.

    As an example have a look at this blogs:

    community.dynamics.com/.../microsoft-dynamics-crm-2011-jquery-amp-jqueryui-part-i.aspx

    community.dynamics.com/.../microsoft-dynamics-crm-2011-jquery-amp-jqueryui-part-ii.aspx

    Here is described how to integrate jquery-ui in crm and we are doing nearly the same things with jquery-ui as described in part2.

    Therefore i think that it would be very problematic when in future crm slef loads the jquery framework in a way that the jquery-ui-framework is disabled.

    Karl

  • Muhammad Adeel Javaid Profile Picture
    5,580 on at
    RE: CRM-Online loads jquery when modifying an account and dettachs jquery-ui-functionality

    The only supported use of jQuery in the Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online web application is to use the jQuery.ajax method to retrieve data from the REST endpoint. Using jQuery to modify Microsoft Dynamics CRM 2011 application pages or forms is not supported.

    For further information you can refer to this link please:

    msdn.microsoft.com/.../gg328025.aspx

  • Karl Andenmatten Profile Picture
    540 on at
    RE: CRM-Online loads jquery when modifying an account and dettachs jquery-ui-functionality

    Hi Muhammad,

    thanks for the links but this blogs describe only the way how to include the jquery-framework in crm what and we did this way. Our problem is now that the crm self imports the crm-framework after our import and this leads to problems.

    Karl

  • Muhammad Adeel Javaid Profile Picture
    5,580 on at
    RE: CRM-Online loads jquery when modifying an account and dettachs jquery-ui-functionality

    I am copying 2 links below and will like you to refer to them:

    www.crmnerd.com/.../using-jquery-in-crm2011

    crmconsultancy.wordpress.com/.../using-jquery-in-crm-2011

    Hope this will be of help for you.

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
HR-09070029-0 Profile Picture

HR-09070029-0 2

#2
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans