Hello All,
I am try to access the Entity records using the Web api and Datatables,Using noraml web api ,DataTables.js and ADAL.js ,Please find the following code,its throwing following error 500,
var fetchxml = "<fetch mapping='logical' page='2' count='10' returntotalrecordcount='true' pagingcookie='%253ccookie%2520page%253d%25221%2522%253e%253caccountid%2520last%253d%2522%257bB8A19CDD-88DF-E311-B8E5-6C3BE5A8B200%257d%2522%2520first%253d%2522%257b475B158C-541C-E511-80D3-3863BB347BA8%257d%2522%2520%252f%253e%253c%252fcookie%253e'>" + " <entity name='account' >" + " <attribute name='address1_city' />" + " <attribute name='name' />" + " </entity>" + "</fetch>"; $("#example").DataTable({ "processing": true, "serverSide": true, "aoColumnDefs": [ { bSortable: true, aTargets: [0] }, { bSortable: false, aTargets: ['_all'] } ], "ajax": { url: encodeURI(organizationURI + "/api/data/v9.0/accounts?fetchXml=" + fetchxml), dataType: 'application/json', method: 'GET', 'beforeSend': function (request) { request.setRequestHeader("Authorization", "Bearer " + token); }, data: function (d) { return d; }, }, columns: [ { title: "Name" }, { title: "City" }, ] });
One more question,passing of bearer in Datables.
Thank,
*This post is locked for comments