+ Start a Discussion
ColoradoMikeColoradoMike 

Clearing the value in a DateTime field?

I'm trying to do something simple... clear the value in a DateTime field.  I'm using C# and the Partner WSDL and the error I'm getting is:
"" is not a valid value for the type xsd:dateTime

Anyone have a suggestion as to how to set a DateTime field to null / empty string?

element[0] = doc.CreateElement("Invoice_Date__c");
element[0].InnerText = "";  // This causes the problem


SuperfellSuperfell
foo.fieldsToNull = { "Invoice_Date__c" };
ColoradoMikeColoradoMike
Ah, of course.  Forgot about that.

Many thanks, Simon!  Hope to meet you at Dreamforce!