You need to sign in to do that
Don't have an account?

Updating custom object records using C# and force API is not working.
Hi folks,
My code for updating records of a custom object is not working as expected.
I thought we would just need to create an object of the same type and assign the id of the record we needed to update and then make our changes. Am I wrong?
Invoice__c invoiceToUpdate = new Invoice__c(); invoiceToUpdate.Id = invoice.Id.ToString(); invoiceToUpdate.Open_Amount__c = Convert.ToDouble(tempTable.Rows[0]["InvoiceOpenAmt"]); invoiceToUpdate.Open_Amount__cSpecified = true; //Update this invoice in Salesforce SaveResult[] results2 = binding.create(new sObject[] { invoiceToUpdate }); if (results2[0].success) { Console.WriteLine("An Invoice record with Id: {0} was updated.", results2[0].id); } else { Console.WriteLine("FAILURE to update Invoice record with Id: {0}", results2[0].id); }
Thanks,
Calvin
It was late night and I was using create() instead of update()..:)