I am using the following link's code to process metadata fields:-
https://code.google.com/p/tridion-practice/wiki/ChangeContentOrMetadata
But when I try to assign value to metadata field of date type then I am getting the following xml validation error:-
" System.ServiceModel.FaultException`1 [myPorject.serviceReference.CoreServiceFault]: XML validation error. Reason: The 'uuid:myUUID:dateField' element is invalid - The value '10/4/2012 03:04:00 AM' is invalid according to its datatype 'http://www.w3.org/2001/XMLSchema:dateTime' - The string '10/4/2012 03:04:00 AM' is not a valid DateTime value.. (Fault Detail is equal to myPorject.serviceReference.CoreServiceFault)"
No matter whether I assign the value as string or DateTime data type I am getting the same error, I have also tried to overload the AddValue method with a Datetime data type but nothing has worked so far.
AddValue method's code snippet:-
public void AddValue(string value1)
{
string value = string.IsNullOrEmpty(value1) ? null : value1; ;
XmlElement newElement = fields.AddFieldElement(definition);
if (value != null) newElement.InnerText = value;
}
Please suggest solution for both Date and Number data type. Thanks in advance