Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Kendo UI List Box With CRM data

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi Every one,

i am trying to load the CRM Entity list in Kendo List box. but with below code, i am not getting the list.

Can any one suggest how to load the CRM all Entity list kendo list box.

Kendo-ui-list.JPG

<!DOCTYPE html>

<html>
<head>
<base href="demos.telerik.com/.../index">
<style>
html {
font-size: 14px;
font-family: Arial, Helvetica, sans-serif;
}
</style>
<title></title>
<link rel="stylesheet" href="kendo.cdn.telerik.com/.../kendo.common-material.min.css" />
<link rel="stylesheet" href="kendo.cdn.telerik.com/.../kendo.material.min.css" />
<link rel="stylesheet" href="kendo.cdn.telerik.com/.../kendo.material.mobile.min.css" />

<script src="kendo.cdn.telerik.com/.../jquery.min.js"></script>
<script src="kendo.cdn.telerik.com/.../kendo.all.min.js"></script>


</head>
<body>

<div>
<table>
<tr>
<td class="auto-style1">Click to Load CRM Entities</td>
<td class="auto-style4">
<button type="button" ID="btnLoadInstance">Load Entities</button>

</td>
</tr>
</table>
</div>

<div id="example" role="application">
<div class="demo-section k-content">
<div>
<label for="optional" id="employees">Entities</label>
<label for="selected">Developers</label>
<br />
<select id="optional">

</select>
<select id="selected"></select>
</div>
</div>
<script>
$(document).ready(function () {

var Query = "EntityDefinitions?$select=DisplayName";
//var req = new XMLHttpRequest();
//req.open("GET", serverURL + "/api/data/v8.2/" + Query, true);

var serverURL = "CRM URL"
var dataSource = new kendo.data.DataSource({
serverFiltering: true, // <-- Do filtering server-side
serverPaging: true,
type: "odata",
transport: {
read: {
url: serverURL + "/api/data/v8.2/" + Query,
dataType: "json"
},
parameterMap: function (options, type) {
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; // <-- The result is just the data, it doesn't need to be unpacked.
},
total: function (data) {
return data.length; // <-- The total items count is the data length, there is no .Count to unpack.

}

}
});
$("#optional").kendoListBox({
dataSource: dataSource,
dataTextField: "Label",
connectWith: "selected",
toolbar: {
tools: ["moveUp", "moveDown", "transferTo", "transferFrom", "transferAllTo", "transferAllFrom", "remove"]
}
});

$("#selected").kendoListBox();
});
</script>
</div>

<style>
.demo-section label {
margin-bottom: 5px;
font-weight: bold;
display: inline-block;
}

#employees {
width: 270px;
}

#example .demo-section {
max-width: none;
width: 515px;
}

#example .k-listbox {
width: 236px;
height: 310px;
}

#example .k-listbox:first-of-type {
width: 270px;
margin-right: 1px;
}
</style>


</body>
</html>

<!DOCTYPE html>
<html>
<head>
<base href="demos.telerik.com/.../index">
<style>
html {
font-size: 14px;
font-family: Arial, Helvetica, sans-serif;
}
</style>
<title></title>
<link rel="stylesheet" href="kendo.cdn.telerik.com/.../kendo.common-material.min.css" />
<link rel="stylesheet" href="kendo.cdn.telerik.com/.../kendo.material.min.css" />
<link rel="stylesheet" href="kendo.cdn.telerik.com/.../kendo.material.mobile.min.css" />

<script src="kendo.cdn.telerik.com/.../jquery.min.js"></script>
<script src="kendo.cdn.telerik.com/.../kendo.all.min.js"></script>


</head>
<body>

<div style="align-items: center">
<h1 style="align-items: center">Portal for Data Obfuscation</h1>
</div>
<div>
<table>
<tr>
<td class="auto-style1">Click to Load CRM Entities</td>
<td class="auto-style4">
<button type="button" ID="btnLoadInstance">Load Entities</button>

</td>
</tr>
</table>
</div>

<div id="example" role="application">
<div class="demo-section k-content">
<div>
<label for="optional" id="employees">Entities</label>
<label for="selected">Developers</label>
<br />
<select id="optional">

</select>
<select id="selected"></select>
</div>
</div>
<script>
$(document).ready(function () {

var Query = "EntityDefinitions?$select=DisplayName";
//var req = new XMLHttpRequest();
//req.open("GET", serverURL + "/api/data/v8.2/" + Query, true);

var serverURL = "CRM URL";
var dataSource = new kendo.data.DataSource({
serverFiltering: true,
serverPaging: true,
type: "odata",
transport: {
read: {
url: serverURL + "/api/data/v8.2/" + Query,
dataType: "json"
},
parameterMap: function (options, type) {
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; // 
},
total: function (data) {
return data.length; //

}

}
});
$("#optional").kendoListBox({
dataSource: dataSource,
dataTextField: "Label",
connectWith: "selected",
toolbar: {
tools: ["moveUp", "moveDown", "transferTo", "transferFrom", "transferAllTo", "transferAllFrom", "remove"]
}
});

$("#selected").kendoListBox();
});
</script>
</div>

<style>
.demo-section label {
margin-bottom: 5px;
font-weight: bold;
display: inline-block;
}

#employees {
width: 270px;
}

#example .demo-section {
max-width: none;
width: 515px;
}

#example .k-listbox {
width: 236px;
height: 310px;
}

#example .k-listbox:first-of-type {
width: 270px;
margin-right: 1px;
}
</style>


</body>
</html>

*This post is locked for comments

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans