Hello everyone,
When I run this code, I get an error because the Unit Size is using this symbol µl. If I pass another alphabet character like L for liters or mL for mililiters it's fine, but when I use microliters (µl) I know it is a conversion problem.
var serverUrl = Xrm.Page.context.getClientUrl(); if (serverUrl.match(/\/$/)) { serverUrl = serverUrl.substring(0, serverUrl.length - 1); } var odataSelect = serverUrl + "/xrmservices/2011/OrganizationData.svc/SalesOrderDetailSet?$select=UnitSize,BaseAmount,BaseAmount_Base,Description,ExchangeRate,ExtendedAmount,ExtendedAmount_Base,IsPriceOverridden,IsProductOverridden,LineItemNumber,ManualDiscountAmount,ManualDiscountAmount_Base&$filter=SalesOrderId/Id eq guid'" + oldOrderId + "'"; $.ajax({ type: "GET", contentType: "application/json; charset=utf-8", datatype: "json", url: odataSelect, async: false, beforeSend: function (XMLHttpRequest) { XMLHttpRequest.setRequestHeader("Accept", "application/json"); }, success: function (data, textStatus, XmlHttpRequest) { if (data && data.d && data.d.results) { //alert(data.d.results.length); CreateOrderProduct(newOrderId, data.d.results); } }, error: function (XmlHttpRequest, textStatus, errorThrown) { alert('OData Select Failed: ' + odataSelect); } }); return true; }
*This post is locked for comments