I am trying to update a record through the SalesForce API (Enterprise WSDL).
The code below does a fine, and the return saveResult says the operation was successful.
However, when I look in SalesForce, the record is not updated. The only thing I can think of is that I'm using the wrong identifier. But I have a five, checked it and checked again, and then checked again.
Has anyone encountered anything similar before? Alternatively, I will be so glad if someone can point out a dumb mistake, which I probably made somewhere :-)
sforce.Participant__c updateParticipant = new sforce.Participant__c(); updateParticipant.Id = participant.Id.Length == 15? participant.Id : participant.Id.Substring(0, 15); if (updateType == "pre") { updateParticipant.Manual_Download_Date__c = DateTime.Now; updateParticipant.Manual_Download__c = true; } else if (updateType == "post") { updateParticipant.Post_Class_Manual_Download__c = true; updateParticipant.Post_Class_Manual_Downloaded_Date__c = DateTime.Now; } sforce.SaveResult[] result = SFLib.sfdc.update(new sforce.sObject[] { updateParticipant }); if (result == null || result.Length <= 0) return false; else { if (result[0].success == true) return true; else throw new Exception("Update participant failed", new Exception(result[0].errors[0].message)); }
c # api salesforce
Robd
source share