Using retrieve Multiple Records in Dynamics 365

| Anas Arshad

Dynamics 365 Xrm.WebApi.retrieveMultipleRecords is a feature that allows developers to retrieve multiple records from a Dynamics 365 organization using Web API. You can use this function to retrieve any kind of record, including accounts, contacts, custom entities, and more.

To use the Xrm.WebApi.retrieveMultipleRecords function, you need to pass the following parameters.

  • entityLogicalName - the logical name of the entity to retrieve.
  • options - an object containing additional options for the request. such as the columns to retrieve, filter criteria, pagination etc.

Here is an example of retrieving all accounts using the Xrm.WebApi.retrieveMultipleRecords function.

Xrm.WebApi.retrieveMultipleRecords("account", "?$select=name,accountnumber").then(

function success(result) {

for (var i = 0; i < result.entities.length; i++) {

console.log(result.entities[i].name);

console.log(result.entities[i].accountnumber);

}

},

function(error) {

console.log(error.message);

}

);

This example retrieves all accounts and specifies the columns to retrieve (name and account number). This function returns a promise containing the result or error in each callback. The result is an object that contains the returned data and metadata, like the total count and the next link, if present.

In summary, Dynamics 365 Xrm.WebApi.retrieveMultipleRecords is a powerful function that allows developers to retrieve multiple records from a Dynamics 365 organization using the Web API. It can be used to retrieve any type of record, including accounts, contacts, and custom entities. With the right parameters, you can retrieve the data you need and use it in your application, including filter and pagination options to retrieve specific data.

Join us next time, as we continue our journey of learning canvas apps.Click here to learn more about Imperium's Power Apps Services. We hope this information was useful, and we look forward to sharing more insights into the Power Platform world.


M
Chief Architect, Founder, and CEO - a Microsoft recognized Power Platform solution architect.

About The Blog

Stay updated with what is happening in the Microsoft Business Applications world and initiatives Imperium is taking to ease digital transformation for customers.


More About Us

We provide guidance and strategic oversight to C-Suite and IT Directors for on-going implementations. Feel free to give us a call.

1 331 250 27 17
Send A Message

Ready to Start?

Get a personalized consultation for your project.

Book a Meeting