| Anas Arshad

Using Xrm.WebApi.retrieveRecord in Dynamics 365

Dynamics 365 Xrm.WebApi.retrieveRecord is a function that allows developers to retrieve a specific record from their Dynamics 365 organization using the 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.retrieveRecord function, you need to pass the following parameters.

  • entityLogicalName - the logical name of the entity to retrieve.
  • id - The GUID of the record to retrieve an object, that contains any additional options for the request, such as the columns you want to retrieve.

Here is an example of using the Xrm.WebApi.retrieveRecord function to retrieve the account with ID abc123.

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

function success(result) {

console.log(result.name);

console.log(result.accountnumber);

},

function(error) {

console.log(error.message);

}

);

In this example, we are retrieving the account with the ID of "abc123", and we are also specifying the columns we want to retrieve, "name" and "accountnumber". The function returns a promise, with the result or error in the respective callbacks.

In Conclusion, Dynamics 365 Xrm.WebApi.retrieveRecord is a powerful function that allows developers to retrieve specific 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.

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.



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