Custom Function using Custom API in D365.
Hello Guys,
In our previous blog we have seen how to create custom API which is nothing but the custom action in old version of the CRM. Today we are going to create Custom Function using Custom API.
But before do follow us to know more about Dynamics and Power Platform. Also if you like our blog then please comment and share this blog with your friends.
Consider a scenario where we need to retrieve more than 5000 records from the CRM using JavaScript or Query Expression. We can not retrieve more than 5000 records at single request using JavaScript. Even while working with Query Expression we can retrieve 5000 records at a time. To retrieve more than 5000 records in a single request we need to implement the concept of Pagination.
Microsoft allows us to create Custom function using Custom API which act as GET Http Method and can be used to retrieve data as per our requirement. Let's understand this using a example. Here we will be creating one plugin which will accept two input parameters named "EntityName" and "Columns" and one output parameter named "Entities" to store Entity Collection.
Start Visual studio and create one Plugin as shown below:
The above code will retrieve records for the entity which was passed as EntityName parameter. Register the plugin using Plugin Registration tool.
Now we will be creating one Custom Function.
Visit https://make.powerapps.com and select your environment and solution.
Now click on New and Select Custom API and configure it as shown below:
Now we will be creating Custom API request parameter. Click on New and select Custom API request parameter and configure it as shown below:
Now we need to Custom API response parameter for storing response. Click on New and select Custom API response parameter and configure it as shown below:
So we are done with creating custom function. Now we will be calling this function to check the result. You can call this function using JavaScript, in C# application using Organization Request or using browser.
Hope it helps....
Comments
Post a Comment