Set datetime field to null

So, I have a problem that someone could solve (or I hope). I have a datetime field that I use in a contenttype (on a listtemplate) that has its own edit form.

Here is a walkthrough of what happens:

  • Adding a value to the datetime column and saving the updated value is displayed (as expected).
  • Updating the datetime column and adding a null value (deleting the value) using editform. The value is not updated, but the old value is displayed instead.

I experimented with this, and I came to the conclusion that if I add an eventreceiver and try to update it there, it will not even go into the eventreceiver as an empty string (I had the idea that the value is equal to the empty string and sharepoint cannot parse this value in null datetime), which makes me think that this is causing a problem with field control. I also found this article on MSDN, which seems to address the same issue. In addition, the datetime field is not required in the content.

Any ideas or suggestions?

UPDATE:

Apparently this only happens when I use a custom form. When I use one of the built-in listtemplates, it works like a charm.

+5
source share
2 answers

, , XML node xml . prevoiusly stardard , . DateTime, -, afterproperties eventreceiver, , . afterproperties, afterproperties. blogpost .

:

blogpost , . : http://johanleino.wordpress.com/2009/08/24/node-demotion-does-not-work-with-blank-empty-values/

0

. . , , , . min/max null , , , .

+1

All Articles