<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Setting value on submit</title><link>https://www.infopathdev.com:443/forums/thread/23382.aspx</link><pubDate>Tue, 02 Oct 2007 09:32:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23382</guid><dc:creator>B.Shiva Prasad</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23382.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=23382</wfw:commentRss><description>&lt;p&gt;Hi stumbler,&lt;/p&gt;
&lt;p&gt;Once see the prefix for the attributes (LastUpdated_by, LastUpdated_time) in the XPath and then&amp;nbsp;try again. I worked out with an example.&lt;/p&gt;
&lt;p&gt;Hope this will help you.&lt;/p&gt;</description></item><item><title>Re: Setting value on submit</title><link>https://www.infopathdev.com:443/forums/thread/23364.aspx</link><pubDate>Mon, 01 Oct 2007 14:19:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23364</guid><dc:creator>Clay Fox</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23364.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=23364</wfw:commentRss><description>&lt;p&gt;Yah, Now going back and looking at your code you have it right.&lt;/p&gt;
&lt;p&gt;I would try specifying a value on your assignment. Set Last Updated by to &amp;quot;Bob&amp;quot; or something to verify this functionality.&lt;/p&gt;
&lt;p&gt;You could also add an alert on the IP field before and after too.&lt;/p&gt;</description></item><item><title>Re: Setting value on submit</title><link>https://www.infopathdev.com:443/forums/thread/23363.aspx</link><pubDate>Mon, 01 Oct 2007 13:52:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23363</guid><dc:creator>stumbler</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23363.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=23363</wfw:commentRss><description>&lt;p&gt;GetLogin() is working fine, just like it should. After &lt;em&gt;sLastUpdated_by = XDocument.DOM.selectSingleNode(&amp;quot;/dfs:myFields/dfs:dataFields/d:EMPLOYEE_NOT_ON_SITE/@LastUpdated_by&amp;quot;) s&lt;/em&gt;LastUpdated_by seems to be &amp;#39;null&amp;#39;&amp;nbsp; (I&amp;#39;ve seen in the Wath window) and cannot be assigned a value.&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;XDocument.UI.Alert(GetLogin()) shows me the correct info.&lt;/p&gt;
&lt;p&gt;About the curDate thing I&amp;#39;m not sure, but I never get to that line in execution.&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Setting value on submit</title><link>https://www.infopathdev.com:443/forums/thread/23362.aspx</link><pubDate>Mon, 01 Oct 2007 13:40:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23362</guid><dc:creator>Clay Fox</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23362.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=23362</wfw:commentRss><description>&lt;p&gt;You would need to debug, I often have an Alert with my variables fire at various points to be able to track their states.&lt;/p&gt;
&lt;p&gt;Have you verified your GetLogin() is working and set you curDate somewhere else?&lt;/p&gt;</description></item><item><title>Re: Setting value on submit</title><link>https://www.infopathdev.com:443/forums/thread/23361.aspx</link><pubDate>Mon, 01 Oct 2007 13:32:37 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23361</guid><dc:creator>stumbler</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23361.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=23361</wfw:commentRss><description>&lt;p&gt;Thanks for the suggestion, but your code doesn&amp;#39;t work.&lt;/p&gt;
&lt;p&gt;Anyhow I tought you first need to declare your variables before assigning a value. I think it has to see with the fact that this code is assigned to a button, the same thing works if it used in the &amp;#39;onafterchange&amp;#39; event of a control.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;</description></item><item><title>Re: Setting value on submit</title><link>https://www.infopathdev.com:443/forums/thread/23359.aspx</link><pubDate>Mon, 01 Oct 2007 13:24:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23359</guid><dc:creator>Clay Fox</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23359.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=23359</wfw:commentRss><description>&lt;p&gt;You have your assignments out of order.&lt;/p&gt;
&lt;p&gt;You set your field values before you GetLogin() and currDate.&lt;/p&gt;
&lt;p&gt;Try This...&lt;/p&gt;
&lt;p&gt;function CmdSave::OnClick(eventObj)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;var curDate = new Date()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;sLastUpdated_by.text = GetLogin();&lt;br /&gt;&amp;nbsp;sLastUpdated_time.text =&amp;nbsp; curDate&lt;br /&gt;&amp;nbsp;var sLastUpdated_by = XDocument.DOM.selectSingleNode(&amp;quot;/dfs:myFields/dfs:dataFields/d:EMPLOYEE_NOT_ON_SITE/@LastUpdated_by&amp;quot;);&lt;br /&gt;&amp;nbsp;var sLastUpdated_time = XDocument.DOM.selectSingleNode(&amp;quot;/dfs:myFields/dfs:dataFields/d:EMPLOYEE_NOT_ON_SITE/@LastUpdated_time&amp;quot;);&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;try&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;// save all changes made.&lt;br /&gt;&amp;nbsp;&amp;nbsp;XDocument.Submit();&lt;br /&gt;&amp;nbsp;&amp;nbsp;}catch(Oeps) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;XDocument.UI.Alert(&amp;quot;Er is een fout opgetreden: \n\n\tOfwel is er een verplicht veld niet ingevuld (rood *),\n\tOfwel is er een ongeldige waarde ingevuld (rode stippellijn)&amp;quot;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;var objEmail = XDocument.DataAdapters(&amp;quot;Sendto2Approver&amp;quot;)&lt;br /&gt;&amp;nbsp;objEmail.Submit()&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Setting value on submit</title><link>https://www.infopathdev.com:443/forums/thread/23358.aspx</link><pubDate>Mon, 01 Oct 2007 13:19:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23358</guid><dc:creator>stumbler</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23358.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=23358</wfw:commentRss><description>&lt;p&gt;With the following code, I try to set 2 field&amp;nbsp;values&amp;nbsp; (LastUpdated_by and LastUpdated_time) at the moment a custom submit button is pressed.&lt;/p&gt;
&lt;p&gt;function CmdSave::OnClick(eventObj)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;var curDate = new Date()&lt;br /&gt;&amp;nbsp;var sLastUpdated_by = XDocument.DOM.selectSingleNode(&amp;quot;/dfs:myFields/dfs:dataFields/d:EMPLOYEE_NOT_ON_SITE/@LastUpdated_by&amp;quot;);&lt;br /&gt;&amp;nbsp;var sLastUpdated_time = XDocument.DOM.selectSingleNode(&amp;quot;/dfs:myFields/dfs:dataFields/d:EMPLOYEE_NOT_ON_SITE/@LastUpdated_time&amp;quot;);&amp;nbsp;&lt;br /&gt;&amp;nbsp;sLastUpdated_by.text = GetLogin();&lt;br /&gt;&amp;nbsp;sLastUpdated_time.text =&amp;nbsp; curDate&lt;br /&gt;&amp;nbsp;try&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;// save all changes made.&lt;br /&gt;&amp;nbsp;&amp;nbsp;XDocument.Submit();&lt;br /&gt;&amp;nbsp;&amp;nbsp;}catch(Oeps) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;XDocument.UI.Alert(&amp;quot;Er is een fout opgetreden: \n\n\tOfwel is er een verplicht veld niet ingevuld (rood *),\n\tOfwel is er een ongeldige waarde ingevuld (rode stippellijn)&amp;quot;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;var objEmail = XDocument.DataAdapters(&amp;quot;Sendto2Approver&amp;quot;)&lt;br /&gt;&amp;nbsp;objEmail.Submit()&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;But it doesn&amp;#39;t work. The variables sLastUpdated_by and sLastUpdated_time point to null. I&amp;#39;m sure one of you knows what I am doing wrong this time.&lt;/p&gt;
&lt;p&gt;Thanks in advance for your help.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>