Showing posts with label DataJS. Show all posts
Showing posts with label DataJS. Show all posts

Tuesday, November 3, 2015

An unknown function with name 'substringof' was found.

While doing some client script have faced the issue.





























  $.each(searchWords, function (key, word) {
                            if (key) filterWords += "%20and%20";
                            // double up any single quotes
                            word = word.replace(/'/g, "''");
                            // url escape word
                            word = encodeURIComponent(word);
                            filterWords += "contains(ProductName,'" + word + "')";
                        });

                        // create base portion of the URI
                        var queryUri = serviceUri + "Products?" +
                          "$select=ProductID,ProductName&" +
                          "$top=100&" +
                          "$filter=" + filterWords;
                        // configure datajs to allow cross domain callbacks using JSONP
                        OData.defaultHttpClient.enableJsonpCallback = true;
                        // run query
                        OData.read(queryUri, function (queryResponse) {
                            // for each result, add to list
                            $.each(queryResponse.value.results, function (o) {
                                $("#queryResultsList").append("

  • " + this.ProductName + "
  • ");