You need to sign in to do that
Don't have an account?
Alex Biddle
Update custom field in salesforce via C# console application
Hi all,
I am facing an issue where I would like to update a SalesForce contacts custom fields within my C# console application for which I am using the SOAP API and the Enterprise WSDL but I am having trouble getting started, I have read that there is an "update" method for this and have got one setup as seen below.
DebuggingInfo debugInfo = _client.update(_header,null,null,null,null,null,null,null,null,null,null,null,null,sobjects,out limitInfo,out saveResult);
Console.WriteLine("debugInfo: " + debugInfo);
Where "_client" is equal to a new SoapClient instance and "_header" is equal to a new session header
"sobjects" is equal to an object of a class I made which will contain the id of the contact i want to update as well as the values of the 2 suppression fields
However, when i run this code i get the value null and the contact on sales force does not update.
Would any be able to give me any advice/pointers on what I am doing wrong?
I am facing an issue where I would like to update a SalesForce contacts custom fields within my C# console application for which I am using the SOAP API and the Enterprise WSDL but I am having trouble getting started, I have read that there is an "update" method for this and have got one setup as seen below.
DebuggingInfo debugInfo = _client.update(_header,null,null,null,null,null,null,null,null,null,null,null,null,sobjects,out limitInfo,out saveResult);
Console.WriteLine("debugInfo: " + debugInfo);
Where "_client" is equal to a new SoapClient instance and "_header" is equal to a new session header
"sobjects" is equal to an object of a class I made which will contain the id of the contact i want to update as well as the values of the 2 suppression fields
However, when i run this code i get the value null and the contact on sales force does not update.
Would any be able to give me any advice/pointers on what I am doing wrong?
Try below code
I hope you find the above solution helpful. If it does mark as best answer to help others too.
Thanks,
Ramesh D
I have changed the code to look like what you have written, although I am a bit confused as to what "_client" is? as in the code I am looking at "_client" is set to private static SoapClient _client; // for API endpoint but when I set "_client.update" and "_client.retrieve" I get an error saying "required fields are not filled in" but from the example you showed it looks as if those fields are not entered, any help on this would be greatly appreciated, thank you :) . As seen in the image attached
Below is my updated code as to what i have so far
_client is salesforce webservice instance, see below code
Thanks
Ramesh