0

I am trying to take an array of address, names, latitude, longitude, etc., then encoding them using JSON.stringify to pass it to a 2nd HTML window that will then map the addresses.

I am hitting a problem when I use JSON.stringify where my data is not fully coming through. Somewhere around 4000 characters my encoded string is truncating.

My issue comes at the line:

var customParameters = encodeURIComponent(JSON.stringify(AddressAray));

Full code section:

var AddressAray = new Array();
debugger;
for (i = 0; i < selectedItems.length; i++) {
    //MY DATA IS ENTERED HERE AND WORKS FINE, 
    //ADDED TO AddressAray with all information.

    AddressAray.push(MixedFields);
},
function (error) {
    alert('GetCurrentUserTerritory: ' + error.message);
},
false);
}

var customParameters = encodeURIComponent(JSON.stringify(AddressAray));
Xrm.Utility.openWebResource("../WebResources/ddscrm_/webpages/CRMPRD.XRM.GoogleMaps.html",customParameters);
}
talemyn
  • 7,822
  • 4
  • 31
  • 52
mh758306
  • 1
  • 2
  • I don't know `Xrm.Utility.openWebResource` but my guess it that the `customParameters` is passed as part of the url, and either truncated by the underlying process of `Xrm.Utility.openWebResource` or on the server side. Url parameter are not intended to pass large data, you should use the request body instead, or client side session storage if the data should stay on the client side. – t.niese Apr 19 '17 at 18:47
  • http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers – rpadovani Apr 19 '17 at 18:47

0 Answers0