Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Error Using Xrm.WebApi on Address Form: jQueryApi is not defined

(0) ShareShare
ReportReport
Posted on by

We are upgrading from Dynamics 365 online v8 to v9. In the onload event for the Address form, we have some javascript that calls the Web API. Currently, we build an XMLHttpRequest to do this, but if possible, I'd like to switch to using the new Xrm.WebApi object. Here's simplified test code:

Xrm.WebApi.retrieveMultipleRecords("customeraddresses").then(
	function(results) {Xrm.Utility.alertDialog("there are results")},
	function(error) {Xrm.Utility.alertDialog(error.message)}
);

We have this code hooked up to both the Contact and Address form onload events. On the Contact form, it works just fine, but on the Address form, we get the following error:

ReferenceError: jQueryApi is not defined
    at XrmClientApi.OnlineSdk.retrieveMultipleRecords (global.ashx?ver=-766924453:4561)
    at Function.Xrm.WebApi.retrieveMultipleRecords (global.ashx?ver=-766924453:2887)
    at RemoveUsedPremierAddressTypes (tre_AddressTypeFilter.js?ver=-766924453:15)
    at AddressOnLoad (tre_AddressFormScript.js?ver=-766924453:6)
    at crmForm_window_onload_handler (FormScript.js.aspx?businessRulesVersion=1033&formid=df5bef3a-9237-40bd-a27c-2cd7fd434706&FormName=crmForm&fver=345355024&isbulkedit=false&ver=-766924453:24)
    at crmFormOnLoadHandler (FormScript.js.aspx?businessRulesVersion=1033&formid=df5bef3a-9237-40bd-a27c-2cd7fd434706&FormName=crmForm&fver=345355024&isbulkedit=false&ver=-766924453:6)
    at executeAction (pageloader.js?ver=-766924453:76)
    at pageloader.js?ver=-766924453:56

I assume this object is missing because the Address form hasn't been updated to match the new UI in v9. Does that mean we will need to continue to create our own XMLHttpRequest for the Address form, or might the form get updated so we can also use Xrm.WebApi there in the near future?

*This post is locked for comments

  • Suggested answer
    Arun Vinoth Profile Picture
    11,615 Moderator on at
    RE: Error Using Xrm.WebApi on Address Form: jQueryApi is not defined

    On a related note - Interestingly Address entity is not listed in neither Legacy (non-refreshed) Entity nor refreshed entity.

    [View:http://www.mohamedmostafa.co.uk/blog/2013/10/21/microsoft-dynamics-crm-2013-refreshed-versus-non-refreshed-legacy-entities-in-the-new-fluid-flat-ux-design/]

  • RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: Error Using Xrm.WebApi on Address Form: jQueryApi is not defined

    Hi,

    I can say this for sure but it from the stack trace, the internal method is failing and like you said, it is possibly be because of the old style form.

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans