Introduction
XRM Toolkit plays an important role for Dynamics CRM Developers to integrate and transfer data from Dynamics CRM and any outside Web Resource developed and implemented in any language including HTML Web Resource: Angular JS: Javascript etc.
In this article, we will be covering steps to consume XRM. For basic steps to create an Angular Application please refer to the previous blog.
Steps
Steps to consume Dynamics CRM – Web API in Dynamics CRM
Now, since we have been able to access the XRM successfully in our Angular JS component, the next step is to access the data from Dynamics CRM to undertake CRUD operations. The simplest way for undertaking this is by accessing the WebAPI.
For the same, need to first install the CRM Rest Builder Solution.
CRM Rest Builder empowers a developer to create Web API requests within a few seconds. This can be used directly in the Angular JS HTML component.
In this example, we will be trying to get the count of Account Records in Dynamics CRM Instance and for the same will be creating a web request
- Adding a <button> tag in app.component.html, on click of this button, we will be calling a method which will be sending out Web API request to Dynamics CRM to get the data.
- Adding a method in the app.component.ts, which will be called on click of a button.
- Bingo: Output