odata – WebAPI 2 does not support substringof function

substringof() is a V3 function while contains() is a V4 function.

Try contains:

$filter=contains(Name,’Queen’)

via odata – WebAPI 2 does not support substringof function – Stack Overflow.

example 1:

var ds = new kendo.data.DataSource({
        type: 'odata',
        serverFiltering: true,
        serverPaging: true,
        pageSize: 10,
        transport: {
            read: {
                url: function () { return '{0}{1}'.format(_appRoot,_serviceUrl); },
                dataType: "json"
            }
            , parameterMap: function (data) {
                var d = kendo.data.transports.odata.parameterMap(data);
                delete d.$inlinecount;
                d.$count = true;

                if (d.$filter) {
                    // substringof('xYz',WorkUnitCode)  needs to 
                    // change to contains(WorkUnitCode,'06')
                    if (d.$filter.substring(0, 12) == 'substringof(') {
                        var parms = d.$filter.substring(12, d.$filter.length - 1).split(',');
                        d.$filter = 'contains({0},{1})'.format(parms[1],parms[0]);
                    }
                }

                return d;
            }
        },
        schema: {
            data: function (data) { return data.value; },
            total: function (data) { return data['@odata.count']; },
            model: _schemaModel
        }
        });

Example 2:

parameterMap: function (data) {
    var d = kendo.data.transports.odata.parameterMap(data);
    if (d.$inlinecount) {
        if (d.$inlinecount == "allpages") {
            d.$count = true;
        }
        delete d.$inlinecount;
    }
    if (d.$filter) {
        d.$filter = d.$filter.replace(/substringof\((.+),(.+)\)/, "contains($2,$1)");
    }
    return d;
}