Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

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

Posted on by Microsoft Employee


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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to convert µl for odata select in CRM javascript?

    sorry scott will look today

  • ScottDurow Profile Picture
    ScottDurow 50,177 on at
    RE: How to convert µl for odata select in CRM javascript?

    Any luck?

  • ScottDurow Profile Picture
    ScottDurow 50,177 on at
    RE: How to convert µl for odata select in CRM javascript?

    Are you passing it in the $filter - or is the error that you are getting when you are parsing the response?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to convert µl for odata select in CRM javascript?

    [quote user="Scott Durow"]

    Try using the escaped version %C2%B5l

    Hope this helps 

    [/quote]

    Thanks Scott, but how could I use that in the odataSelect statement?

    I am passing the value through the column name

  • Suggested answer
    ScottDurow Profile Picture
    ScottDurow 50,177 on at
    RE: How to convert µl for odata select in CRM javascript?

    Try using the escaped version %C2%B5l

    Hope this helps

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans