web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

How to set retrivemultiple result data to data source of Kendo grid?

(0) ShareShare
ReportReport
Posted on by 55
I have use this HTML web resource to show 'Queue I am member of' data to table and I want to implement code to get default queue value and change the default value as per the radio button selected value which is the  'Queue I am member of'  data. I need help to set retrieve multiple data into dataSource of kendo grid. I think we get json data for result but not able to see the result as I need
<html>
  <head>
    <meta charset="utf-8" />
    <title>Download Table</title>

    <link
      rel="stylesheet"
    />

    <script src="code.jquery.com/jquery-1.12.4.min.js"></script>
    <script src="kendo.cdn.telerik.com/.../kendo.all.min.js"></script>
    <meta />
    <meta />
  </head>
  <body onfocusout="parent.setEmailRange();" style="overflow-wrap: break-word">
    <div id="grid"></div>
    <script type="text/javascript">
      debugger;
      var jsonData;
      $(document).ready(function () {
        var queueFetchXML =
          "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>" +
          "  <entity name='queue'>" +
          "    <attribute name='name'/>" +
          "    <attribute name='queueid'/>" +
          "    <order attribute='name' descending='false'/>" +
          "    <link-entity name='queuemembership' from='queueid' to='queueid' visible='false' intersect='true'>" +
          "      <link-entity name='systemuser' from='systemuserid' to='systemuserid' alias='ab'>" +
          "        <filter type='and'>" +
          "          <condition attribute='systemuserid' operator='eq-userid'/>" +
          '        </filter>' +
          '      </link-entity>' +
          '    </link-entity>' +
          '  </entity>' +
          '</fetch>';

        queueFetchXML = '?fetchXml=' + encodeURIComponent(queueFetchXML);

        window.parent.Xrm.WebApi.retrieveMultipleRecords(
          'queue',
          queueFetchXML
        ).then(function success(result) {
          debugger;

          jsonData = result.entities;
          console.log('json inside xrm: ' + jsonData);
        });
        console.log('json outside xrm: ' + jsonData);

        $('#grid').kendoGrid({
          dataSource: {
            data: jsonData,
            type: 'odata',
            transport: {
              read: 'demos.telerik.com/.../Orders',
            },
            schema: {
              model: {
                fields: {
                  name: { type: 'string' },
                },
              },
            },
          },

          columns: [
            {
              field: 'name',
              title: `Queue I'm a member of`,
              width: 150,
            },

            {
              title: 'Default Queue',
              width: 150,
              template: "<input type='radio' id='manualTab' name='manualTab' >",
            },
          ],
          dataBound: function (e) {
            debugger;
            $("input[name='manualTab']").on('click', function (e) {
              var grid = $('#grid').data('kendoGrid');
              var dataItem = grid.dataItem($(e.target).closest('tr'));
              alert(dataItem.name);
            });
          },
        });
      });
    </script>
  </body>
</html>
I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    I would recommend to convert the collection you received as a response to an array of objects and use setDataSource method of the grid - docs.telerik.com/.../setdatasource

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 164 Super User 2026 Season 1

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 51 Most Valuable Professional

#3
NeerajPawar Profile Picture

NeerajPawar 42

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans