Using dynamics CRM FetchXML with Xrm.WebApi.retrieveMultipleRecords in Dynamics 365 V9
Dynamics Web API is a tool to use the CRM functionality of Dynamics 365 creating a much easier way for developers to get information. With the API, you can use HTTP requests to pull data from Dynamics CRM with the use of order, filter, and select depending on scenarios. The new Dynamics CRM API also gives you the option of pushing dynamics CRM FetchXML into the request for scenarios.
The Xrm.WebApi.retrieveMultipleRecords method allows to retrieve records from FetchXML, but MSDN only gives examples to use this with the OData query options. However, new Dynamics CRM API allows the developers to use fetchXML queries.
We can extract dynamics CRM FetchXML from advanced find.
Below is extracted Dynamics CRM FetchXML from Advanced Find.
Creating JS for Execution
We have the query ready to send and get the desired results.
There is a limitation of 2047 characters in a query as Internet Explorer and Edge only support up to that in a URL, so very large dynamics CRM FetchXML queries will cause an error in those browsers.
Hope this will be helpful.
So, we can use Xrm.WebApi.retrieveMultipleRecords Dynamics 365 API function in JS to retrieve multiple records from FetchXML.