Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

How to pass a value on a textbox field from a form to a C# plugin using Web Api

$
0
0

Hi:

I am using an onpremise version of CRM 2016.

I have been reading a lot of the tutorials on how to use the Web Api but I have not found any resources that show me how to pass a value on a textbox field from a form (client side) to a C# plugin using Web Api that will update by adding or updating records to the SQL database.

privateJObject contact1 = newJObject()

contact1.Add("firstname", "Peter");

contact1.Add("lastname", "Campbell");

HttpRequestMessage createRequest1 = newHttpRequestMessage(HttpMethod.Post, getVersionedWebAPIPath() + "contacts");

createRequest1.Content = newStringContent(contact1.ToString(),Encoding.UTF8, "application/json");

HttpResponseMessage createResponse1 = await httpClient.SendAsync(createRequest1);

From the above you will see that I added "Peter" and "Campbell" to the firstname and lastname fields. How would this be done if firstname and lastname were instead form textbox fields?

Steve


Viewing all articles
Browse latest Browse all 46379

Trending Articles



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