locked
How to create OData query with specific chars? RRS feed

  • Question

  • Here is example of query:

    SDK.JQuery.retrieveMultipleRecords("Account", "$select=Fax,Name&$filter=Name eq '"+ name +"'" ....);

    It works fine. But only with Latin chars in "name".

    How to build the query if "name" contains Cyrillic chars or symbols of quotes?


    Если сообщение оказалось полезным, пожалуйста, проголосуйте за него или пометьте в качестве ответа.

    Thursday, May 22, 2014 7:53 AM

Answers

  • Hi,
    try to encode first the name value with the javascript function encodeURIcomponent()

    something like:

    var encodedName = encodeURIcomponent(name);
    SDK.JQuery.retrieveMultipleRecords("Account", "$select=Fax,Name&$filter=Name eq '"+ encodedName +"'" ....);


    My blog: www.crmanswers.net - Rockstar 365 Profile

    • Marked as answer by Dismantled Thursday, May 22, 2014 9:24 AM
    Thursday, May 22, 2014 8:23 AM