asp.net mvc 4 - Kendo UI grid getting data from Dynamics CRM -


i have strange problem getting data dynamics crm online kendo ui data grid , when inspect chrome browser, error

enter image description here

but when use cors error disappear , new error indicating request unauthorized 401,

enter image description here

please me error, in attachment find source code lot

function onready() {      $("#btnsearch").kendobutton({         click: onsearch     })      $("#kgrid").kendogrid({         datasource: {             type: "odata",             transport: {                 read: {                     type: "post",                     datatype: "application/json",                     url: 'https://cynapsyscrm.api.crm4.dynamics.com/api/data/v8.1/accounts',                     xhrfields: {                         withcredentials: true                     }                 },                 parametermap: function (options, operation) {                     var parammap = kendo.data.transports.odata.parametermap(options);                     delete parammap.$inlinecount; // <-- remove inlinecount parameter                     delete parammap.$format; // <-- remove format parameter                      return parammap;                 }             },             schema: {                 data: function (data) {                     return data; // <-- result data, doesn't need unpacked.                 },                 total: function (data) {                     return data.length; // <-- total items count data length, there no .count unpack.                 }             },             serverpaging: true,             serverfiltering: true,             pagesize: 20         },         height: 550,         pageable: true,         columns: [             'accountid',             'accountname',             'numberofemployees',             'revenue',             'primarycontact',             'primarycontactname'         ]       })   }    $(document).ready(onready); 

based on screenshot, you're trying access crm online domain localhost. can't because cross domain issue , don't think ms enable "localhost" allowed domain :)

try deploy test crm instance or maybe test code using unit tests.

hope helps