Quantcast
Channel: Microsoft Dynamics CRM
Viewing all articles
Browse latest Browse all 154803

Forum Post: How to increase performance of Odata Post Call to dynamics

$
0
0
I am trying to create a case using an odata post call and my request looks something like" var client = new RestClient("{{base}}/api/data/v9.1/incidents?$select=incidentid,ticketnumber"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Accept", "application/json"); request.AddHeader("X-TraceId", "1006"); request.AddHeader("Authorization", " "); request.AddHeader("OData-MaxVersion", "4.0"); request.AddHeader("OData-Version", "4.0"); request.AddHeader("Content-Type", "application/json"); request.AddHeader("Prefer", "return=representation"); request.AddParameter("application/json", "{\r\n \"title\": \"test case\",\r\n \"description\": \"hello\",\r\n \"prioritycode\": \"1\",\r\n \"ent_recordtype\": \"1\",\r\n \"ent_langparam\": \"en_US\",\r\n \"caseorigincode\": \"5\",\r\n \"casetypecode\": \"2\",\r\n \"productid@odata.bind\": \"products(abc)\",\r\n \"ent_customer@odata.bind\": \"ent_organizationcontacts()\",\r\n \"customerid_account@odata.bind\": \"accounts(abc)\",\r\n \"ent_contact@odata.bind\": \"contacts(abc)\"\r\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content); This request takes an avg of 2.5s to return the response which is way higher than the client's expectations. Is there any way I can improve the performance of this request? Any help is appreciated.

Viewing all articles
Browse latest Browse all 154803

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>