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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

How I can retrieve data and print more 5000 record with pagination: javascript

(0) ShareShare
ReportReport
Posted on by 10

Hi,

I want to develop grid with javascript without framework , and I need some help in order to retrieve all record and print it with concat (pagination)

this is my code : 

<html>
<head>
<meta>
<title>Hello, Bootstrap Table!</title>
<link src="">maxcdn.bootstrapcdn.com/.../bootstrap.min.css" rel="stylesheet">
<link src="">cdnjs.cloudflare.com/.../font-awesome.css" rel="stylesheet">
<style type="text/css">
.content-info {
background: #f9f9f9;
padding: 40px 0;
background-size: cover!important;
background-position: top center!important;
background-repeat: no-repeat!important;
position: relative;
padding-bottom:100px;
}

table {
width: 100%;
background: #fff;
border: 1px solid #dedede;
}

table thead tr th {
padding: 20px;
border: 1px solid #dedede;
color: #000;
}

table.table-striped tbody tr:nth-of-type(odd) {
background: #f9f9f9;
}

table.result-point tr td.number {
width: 100px;
position: relative;
}

.text-left {
text-align: left!important;
}

table tr td {
padding: 10px 20px;
border: 1px solid #dedede;
}
table.result-point tr td .fa.fa-caret-up {
color: green;
}

table.result-point tr td .fa {
font-size: 20px;
position: absolute;
right: 20px;
}

table tr td {
padding: 10px 40px;
border: 1px solid #dedede;
}

table tr td img {
max-width: 32px;
float: left;
margin-right: 11px;
margin-top: 1px;
border: 1px solid #dedede;
}


</style>

</head>
<body>
<script>
document.onreadystatechange = function () {
if (document.readyState === "complete") {
testFXML();
}
};

var fxml = ["<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>"
, "<entity name='account'>"
, "<attribute name='name' />"
, "<attribute name='adress' />"
, " <attribute name='age' />"

, "</entity>"
, "</fetch>"].join();
fxml = "?fetchXml=" + encodeURIComponent(fxml);



var testFXML = function () {
parent.Xrm.WebApi.retrieveMultipleRecords("account", fxml, 3).then(

function (resp) {
if (resp != null && resp.entities.length > 0) {

const tb = document.getElementById("tb");
let tr = [];
resp.entities.forEach(item => {
tr.push('<tr><td>' + item.name + '</td>')
tr.push('<td>' + item.adress + '</td>')
tr.push('<td>' + item.age + '</td>')
})
tb.innerHTML = tr.join("");
document.getElementById("result").classList.remove("hide"); // show
//I don't know how to retrieve this url and use it for my others request and next page
console.log("Paging cookie: " + resp.fetchXmlPagingCookie);


}
}
);
}


</script>

<input type="button" onclick="testFXML()" value="some entities testFXML" accesskey="s">
<section class="content-info">
<div class="container paddings-mini">
<div class="row">
<div id="result" class="col-lg-12">
<table class="table-striped table-responsive table-hover result-point">
<thead class="point-table-head">
<tr class="bg-light">
<th>name</th>
<th>adress</th>
<th>age</th>
</tr>
</thead>
<tbody id="tb"></tbody>
</table>
</div>
</div>
</div>
</section>


<script charset="utf8" src="">stackpath.bootstrapcdn.com/.../script>
<script charset="utf8" src="">cdnjs.cloudflare.com/.../script>

</body>
</html>
on this url they explainhow to use pagincookie but it's not printed on html
I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    Please have a look at below article

    blog.magnetismsolutions.com/.../query-paging-using-dynamics-365-webapi

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 108 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans