in C# when applying a category, sometime I have a date to apply, but sometime I don't ..
What do you pass then for the value (null is not working or an empty string) (I will get supply value is empty)
Tks
Hi Pierre,
I set up a category, with a Calendar Attribute Date, provided it some data, in the WebUI.
I then called it down, and changed it to a null:
Node myNode = docCli.GetNode(ref Auth, 148886);
((CS16_Category_Manipulation.cws.DateValue)myNode.Metadata.AttributeGroups[0].Values[0]).Values[0] = null;
docCli.UpdateNode(ref Auth, myNode);
It appears blank, in the WebUI.
Is there an exception when you try to set it to null? Does it do anything weird like revert to some default value?
Thanks.
Tks, you snipit made me think of something.
It wasn't the saving the null value causing the issue, it was prior to saving, when the code, was parsing the null field as a date, that was failing.
(dataValue as DateValue).Values.SetValue(DateTime.Parse(metadataItem.Values[i]), i);)
Tks again
Ah, that makes sense!
You're very welcome.