Search code examples
javascriptajaxdynamics-crm-2016dynamics-crm-webapi

What should be used for Multiple Entity Search functionality, Web API or Manual Query?


I am going to create a functionality which allow user to search from their selected entities and fields using Microsoft Dynamic CRM 2016 Online. I would do like to know that which one is faster for searching? Web API or Manual Query using javascript/Ajax call?

For Exampla

//Manual Query search with Ajax:
var oDataUri = serverUrl + `"/XRMServices/2011/OrganizationData.svc/new_productSet?$filter=new_productid eq '" + productid + "';`

//Web API call for search with Ajax:
GET [Organization URI]/api/data/v8.1/accounts?$select=name HTTP/1.1

Please suggest me so I can decide my path ahead. Thank you.


Solution

  • I suggest you use the Web API, it is lighter because it returns a JSON object unlike javascript / Ajax that returns an xml that may be a little heavier.