<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Getting the date through JScript</title><link>https://www.infopathdev.com:443/forums/thread/22460.aspx</link><pubDate>Tue, 21 Aug 2007 09:43:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22460</guid><dc:creator>romaik</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22460.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22460</wfw:commentRss><description>&lt;p&gt;The only way I could sort out this problem was using a new entry in the primary data source.&lt;br /&gt;Now it works great. Too bad InfoPath cannot get the file that he is opening, this would have solve the problem :s&lt;/p&gt;&lt;p&gt;&amp;nbsp;Thank you both for the help&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Getting the date through JScript</title><link>https://www.infopathdev.com:443/forums/thread/22451.aspx</link><pubDate>Tue, 21 Aug 2007 06:41:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22451</guid><dc:creator>Shiva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22451.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22451</wfw:commentRss><description>&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;You have to write the below code in onContextChange event: &lt;/p&gt;
&lt;p&gt;public void OnContextChange(DocContextChangeEvent e) &lt;/p&gt;
&lt;p&gt;{ &lt;/p&gt;
&lt;p&gt;//Get the modified date. var modifiedDate = XDocument.DOM.selectSingleNode(&amp;quot;my:Observer/my:creation&amp;quot;).text; &lt;/p&gt;
&lt;p&gt;if(modifiedDate.length != 0) &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; { &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDocument.View.Window.Caption = modifiedDate; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; } &lt;/p&gt;
&lt;p&gt;} &lt;/p&gt;
&lt;p&gt;&amp;nbsp;For every time saving the form you have to set the modified date to above field(my:creation). &lt;/p&gt;
&lt;p&gt;Hope this Help you&lt;/p&gt;</description></item><item><title>Re: Getting the date through JScript</title><link>https://www.infopathdev.com:443/forums/thread/22441.aspx</link><pubDate>Mon, 20 Aug 2007 15:44:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22441</guid><dc:creator>romaik</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22441.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22441</wfw:commentRss><description>&lt;p&gt;I tried to do this &lt;/p&gt;&lt;p&gt;		var d = new Date();&lt;br /&gt;XDocument.DOM.selectSingleNode(&amp;quot;my:Observer/my:creation&amp;quot;).text = d.toDateString();&lt;/p&gt;&lt;p&gt;in the code of my saving button, but it does not work :s.&lt;br /&gt;It says : #PCDATA is in a nul content : &amp;lt;{http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-06-18T14:29:33}creation&amp;gt;.&lt;/p&gt;&lt;p&gt;and the line corresponding to&amp;nbsp; XDocument.DOM.selectSingleNode(&amp;quot;my:Observer/my:creation&amp;quot;).text = d.toDateString();&lt;/p&gt;&lt;p&gt;I decided to put only one element : the date of last modification. here is the scenario.&lt;br /&gt;- First time, my element is empty and hidden. My button saves and quit, so before saving, I put the Now date into it.&lt;br /&gt;- Open an existing form (just to read it). Nothing will be modified since he will quit using the red cross.&lt;br /&gt;- Open an existing form to modify it. Since he is gonna save through my button, the Now date will be put inside my element.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;What I wanted to do something like this (for the scenario of the existing form) but it does not work at all : &lt;/p&gt;&lt;p&gt;var uri = XDocument.URI;&lt;br /&gt;var file = new File(u);&lt;br /&gt;XDocument.View.Window.Caption = file.DateLastModified;&lt;/p&gt;&lt;p&gt;Any idea on those two points ?&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Getting the date through JScript</title><link>https://www.infopathdev.com:443/forums/thread/22440.aspx</link><pubDate>Mon, 20 Aug 2007 14:48:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22440</guid><dc:creator>Shiva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22440.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22440</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can set the today date and time value in title bar. You can write below the code in OnContextChange event.&lt;/p&gt;
&lt;p&gt;thisXDocument.View.Window.Caption = DateTime.Now.ToString();&lt;/p&gt;
&lt;p&gt;This method will call every time changes made on the form. For avoid this calling function you have to use one global variable.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Hope this help you.&lt;/p&gt;</description></item><item><title>Re: Getting the date through JScript</title><link>https://www.infopathdev.com:443/forums/thread/22436.aspx</link><pubDate>Mon, 20 Aug 2007 14:22:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22436</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22436.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22436</wfw:commentRss><description>hi i would use two fields and a dummy variable for that. The initial date I would get in the OnLoad event of the document like this: function XDocument::OnLoad(eventObj) { var dummy = 0; var date = new Date(); if(dummy == 0) { XDocument.DOM.selectSingleNode(&amp;quot;my:myFields/my:newDate&amp;quot;).text = date.toDateString(); dummy++; } } Then in the button click event after the updates are done an the form is resaved (you need a custom button for this) I would do a similar thing: var date = new Date();&amp;nbsp;XDocument.DOM.selectSingleNode(&amp;quot;my:myFields/my:DateLastModified&amp;quot;).text = date.toDateString(); Does this help ?</description></item><item><title>Getting the date through JScript</title><link>https://www.infopathdev.com:443/forums/thread/22432.aspx</link><pubDate>Mon, 20 Aug 2007 11:39:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22432</guid><dc:creator>romaik</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22432.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22432</wfw:commentRss><description>&lt;p&gt;Hi every one.&lt;/p&gt;&lt;p&gt;I am trying to use dates through my form.&lt;/p&gt;&lt;p&gt;Here is the scenario :&lt;br /&gt;- If I open a new form, I would like the title bar to display some information, including the date (of the day like 20/08/2007)&lt;br /&gt;- If I open an already existing form, it displays in the title bar the day the form was last modified.&lt;/p&gt;&lt;p&gt;I work with InfoPath Sp2 and JScript.&lt;br /&gt;I can&amp;#39;t find it in the InfoPathSDK :s&lt;br /&gt;&lt;br /&gt;thanks for the help&lt;/p&gt;&lt;p&gt;Regards,&lt;br /&gt;Romain&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>