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
I have the same question (0)