You need to sign in to do that
Don't have an account?
Jegadish
Error in setting value for DateTime type custom field
I get the following error while update the contact.
Error: '2006-09-06' is not a valid value for the type xsd:dateTime
This is happening when we set the value for DateTime type custom field. I am setting value as
sContact.RECEIPT_STATE_DATE_02__cSpecified = true;
sContact.RECEIPT_STATE_DATE_02__c = DateTime.Now;
sContact.RECEIPT_STATE_DATE_02__c = DateTime.Now;
Based on one of the replies from this forum I tried the following but gives compilation error.
sContact.RECEIPT_STATE_DATE_02__cSpecified = true;
sContact.RECEIPT_STATE_DATE_02__c = (System.DateTime)DateTime.Now.ToString("s", System.Globalization.DateTimeFormatInfo.InvariantInfo);
sContact.RECEIPT_STATE_DATE_02__c = (System.DateTime)DateTime.Now.ToString("s", System.Globalization.DateTimeFormatInfo.InvariantInfo);
I am using MS VS 2005. Please let me know how to resove this error.
For the Salesforce date type:
xmlNode.InnerText = tmpDate.ToUniversalTime().ToString("yyyy-MM-dd");
For the Salesforce datetime type:
xmlNode.InnerText = tmpDate.ToUniversalTime().ToString("s");
Hope this helps.
What happens when you regenerate your WSDL at
https://na1.salesforce.com/soap/wsdl.jsp?type=*
and rebuild?
Hi,
The type has not been changed. It is xsd:datetime only.
<element name="RECEIPT_STATE_DATE_01__c" nillable="true" minOccurs="0" type="xsd:dateTime" />
Please let me know if you aware of some other way to set this value using C#.NET 2.0
Thanks,
Jegatheesan.
Did regenerating the WSDL and rebuilding the proxy objects help?
Thanks Mike.
I have informed the support team about this issue. They are looking into it.
I will update once I get answer from them.
Thanks,
Jegdish.
Hi Jegadish,
Did you find a solution? I have the same exact problem.... unfortunately. From my experience, opening a ticket with salesfoce is not very helpful... I appreciate it very much if you could share your solution.
Thanks in advance,
Saritha
Message Edited by saritha78 on 11-10-2006 01:22 PM
http://community.salesforce.com/sforce/board/message?board.id=NET_development&message.id=4069