Please wait, loading...

 
Follow link to “Retrieve multiple entity record using Web API ” above step is required to understand the how to connect with Dynamics 365 using Web API.

for update we can use SendAsync

———————————————————————————-

JObject content= new JObject();
                    content.Add(“statuscode”, “100000000”);
                    content.Add(“statecode”, “0”);

                    content.Add(“new_name”,“name”);

 HttpRequestMessage updateRequest2 = new HttpRequestMessage(new HttpMethod(“PATCH”),  “[Organization URL]api/data/v9.0/new_test(00000000-0000-0000-0000-000000000001)?$select=new_testid,statuscode,statecode,sab_name”  );
                        updateRequest2.Content = new StringContent(Content.ToString(),Encoding.UTF8, “application/json”);
                        HttpResponseMessage updateResponse1 = httpClient.SendAsync(updateRequest2).Result;
                        if (updateResponse1.IsSuccessStatusCode)
                        {
                            //Get the response content  and parse it.
                           JObject body = new JObject();
                            body.Add(“success”, “true”);
                            return body;
                        }
                        else
                        {
                            throw new Exception(“error”);

                        }

————————————————————————————–

Hope this helped. thanks

SOURCE : mscrm.com

https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/Microsoftdynamics365.png?fit=640%2C651&ssl=1
Microsoft Dynamics Community Profile

Learn more