Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

How to convert µl for odata select in CRM javascript?

$
0
0


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; }



Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>