I tried to do this
var d = new Date();
XDocument.DOM.selectSingleNode("my:Observer/my:creation").text = d.toDateString();
in the code of my saving button, but it does not work :s.
It says : #PCDATA is in a nul content : <{http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-06-18T14:29:33}creation>.
and the line corresponding to XDocument.DOM.selectSingleNode("my:Observer/my:creation").text = d.toDateString();
I decided to put only one element : the date of last modification. here is the scenario.
- First time, my element is empty and hidden. My button saves and quit, so before saving, I put the Now date into it.
- Open an existing form (just to read it). Nothing will be modified since he will quit using the red cross.
- Open an existing form to modify it. Since he is gonna save through my button, the Now date will be put inside my element.
What I wanted to do something like this (for the scenario of the existing form) but it does not work at all :
var uri = XDocument.URI;
var file = new File(u);
XDocument.View.Window.Caption = file.DateLastModified;
Any idea on those two points ?