<?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: Programmatically Copy Date Field From Secondary Connection Reapeating Table into Date Field within Main Connection Reapting Table</title><link>https://www.infopathdev.com:443/forums/thread/89320.aspx</link><pubDate>Mon, 29 Apr 2013 14:45:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:89320</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/89320.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=89320</wfw:commentRss><description>&lt;p&gt;Do you need for users to be able to change this data? If not, you can use an expression box (calculated value) and even leaving the data type as string, display as date formatted. If it is a date data type, you&amp;#39;ll need to remove the nil attribute prior to setting the value. Search &lt;a href="http://msdn.microsoft.com/en-us/library/office/bb509311(v=office.12).aspx"&gt;this&lt;/a&gt; article for nil to find the section on how to do that programmatically.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Programmatically Copy Date Field From Secondary Connection Reapeating Table into Date Field within Main Connection Reapting Table</title><link>https://www.infopathdev.com:443/forums/thread/89311.aspx</link><pubDate>Mon, 29 Apr 2013 01:18:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:89311</guid><dc:creator>Jim Shorts</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/89311.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=89311</wfw:commentRss><description>&lt;p&gt;Hi Hilary, and thank you very much for your response.&amp;nbsp; Currently, the main data connection field is set as a single line of text field.&amp;nbsp; When I right click on the field and go into the text box properties screen, I see that I am able to set this field as a Data Type: Date and then go in and format according to my needs.&amp;nbsp; However, once I do this (even when I select the Date and Time data type), I continually get an error once the data is passed from my secondary connection to my main connection:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;quot;System.InvalidOperationException&lt;br /&gt;Schema validation found non-data type errors.&lt;br /&gt;&amp;nbsp;&amp;nbsp; at Microsoft.MsoOffice.InfoPath.MsxmlInterop.MsxmlDocument.ThrowExceptionFromMsxmlInteropError(MsxmlInteropError eError)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at Microsoft.MsoOffice.InfoPath.MsxmlInterop.MsxmlDocument.ThrowExceptionFromHresult(Int32 hrError)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at Microsoft.MsoOffice.InfoPath.MsxmlInterop.MsxmlNodeImpl.set_Text(String strText)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at Microsoft.Office.InfoPath.MsxmlNavigator.SetValue(String value)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at Date_Change_Test_Library_Form_Template.FormCode.AddValue(XPathNavigator source, XPathNavigator target, String sourcePath, String targetPath)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at Date_Change_Test_Library_Form_Template.FormCode.AddRow(Object sender, ClickedEventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Perhaps you&amp;#39;re talking of another way that I can format the control to display the way I&amp;#39;m wanting to see it?&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Programmatically Copy Date Field From Secondary Connection Reapeating Table into Date Field within Main Connection Reapting Table</title><link>https://www.infopathdev.com:443/forums/thread/89310.aspx</link><pubDate>Sun, 28 Apr 2013 23:16:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:89310</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/89310.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=89310</wfw:commentRss><description>&lt;p&gt;The date string you have is a valid date / time for XML - so you could just format the control to display this the way you want to see it (MM/DD/YYYY).&lt;/p&gt;</description></item><item><title>Re: Programmatically Copy Date Field From Secondary Connection Reapeating Table into Date Field within Main Connection Reapting Table</title><link>https://www.infopathdev.com:443/forums/thread/89308.aspx</link><pubDate>Sun, 28 Apr 2013 19:27:35 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:89308</guid><dc:creator>Jim Shorts</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/89308.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=89308</wfw:commentRss><description>&lt;p&gt;Thank you for the response, Patrick.&amp;nbsp; I do appreciate the input.&amp;nbsp; However, there are quite a few other things that are going on with this form that I haven&amp;#39;t shown in this example which lead me to have to do a fully coded solution.&amp;nbsp; I really like your example and wish I would have found it sooner as it would have saved me about a weeks worth of headaches trying to complete this part using just rules.&amp;nbsp; However, even if I would have gone the rules route, I still would have the same question with your example as I have with my coded solution: How would I go about copying a date field from a secondary query data connection into a date field within my main connection?&amp;nbsp; As of right now, I can copy over the date field from my secondary connection into a single line of text field on my main connection, but i get this output: 2012-01-30T00:00:00.&amp;nbsp; Any ideas for converting that to a format of MM/DD/YYYY?&amp;nbsp; Thanks again!&lt;/p&gt;</description></item><item><title>Re: Programmatically Copy Date Field From Secondary Connection Reapeating Table into Date Field within Main Connection Reapting Table</title><link>https://www.infopathdev.com:443/forums/thread/89307.aspx</link><pubDate>Sun, 28 Apr 2013 18:28:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:89307</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/89307.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=89307</wfw:commentRss><description>&lt;p&gt;Hi Jim Shorts,&lt;/p&gt;&lt;p&gt;Well, you certainly don&amp;#39;t need code for this. Date fields have an xsi:nil attribute that needs to be set correctly (or removed). That&amp;#39;s probably why you&amp;#39;re having trouble. Why not just use rules to do this? Then, you don&amp;#39;t have to worry about the attributes. &lt;/p&gt;&lt;p&gt;Here&amp;#39;s a link to a sample that shows how to copy with rules: &lt;a href="http://www.infopathdev.com/blogs/patrick/archive/2011/09/03/free-sample-copying-repeating-data.aspx"&gt;http://www.infopathdev.com/blogs/patrick/archive/2011/09/03/free-sample-copying-repeating-data.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Good luck!&lt;/p&gt;</description></item><item><title>Programmatically Copy Date Field From Secondary Connection Reapeating Table into Date Field within Main Connection Reapting Table</title><link>https://www.infopathdev.com:443/forums/thread/89306.aspx</link><pubDate>Sun, 28 Apr 2013 15:11:35 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:89306</guid><dc:creator>Jim Shorts</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/89306.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=89306</wfw:commentRss><description>&lt;div class="container"&gt;
&lt;div class="body"&gt;
&lt;p&gt;Hi, I currently have an IP2010 Library Form that populates a repeating table from a secondary connection (table that is left of the solid black line).&amp;nbsp; Within that secondary connection, I&amp;#39;ve created a button on each row of the repeating table the the user can click and it will populate a new row within a repeating table on my Main Data Connection (to the right of the solid black line).&amp;nbsp; I have not problem getting the text fields to copy over, but I am running into some trouble when trying to copy the date field from the secondary connection into the date field on the main connection.&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://social.technet.microsoft.com/Forums/getfile/277785" width="668" height="159" /&gt;&lt;/p&gt;
&lt;p&gt;Here is the code as it stands now:&lt;/p&gt;&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;            &lt;/span&gt;&lt;span class="typ"&gt;XPathNavigator&lt;/span&gt;&lt;span class="pln"&gt; nav &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;MainDataSource&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;CreateNavigator&lt;/span&gt;&lt;span class="pun"&gt;().&lt;/span&gt;&lt;span class="typ"&gt;SelectSingleNode&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;&amp;quot;/my:myFields/my:dataFields/my:repeatingGroup[last()]&amp;quot;&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;NamespaceManager&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
            &lt;/span&gt;&lt;span class="typ"&gt;XPathNavigator&lt;/span&gt;&lt;span class="pln"&gt; row &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; nav&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;Clone&lt;/span&gt;&lt;span class="pun"&gt;();&lt;/span&gt;&lt;span class="pln"&gt;
            row&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;InsertAfter&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;nav&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
            &lt;/span&gt;&lt;span class="typ"&gt;AddValue&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;e&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;Source&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; row&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;&amp;quot;d:Title&amp;quot;&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;&amp;quot;my:EventName&amp;quot;&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
            &lt;/span&gt;&lt;span class="typ"&gt;AddValue&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;e&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;Source&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; row&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;&amp;quot;d:Event_x0020_Type&amp;quot;&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;&amp;quot;my:EventType&amp;quot;&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
            &lt;/span&gt;&lt;span class="typ"&gt;AddValue&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;e&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;Source&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; row&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;&amp;quot;d:Event_x0020_Location&amp;quot;&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;&amp;quot;my:EventLocation&amp;quot;&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
            &lt;/span&gt;&lt;span class="typ"&gt;AddValue&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;e&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;Source&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; row&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;&amp;quot;d:Planned_x0020_Start&amp;quot;&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;&amp;quot;my:CurrentPlannedStartDate&amp;quot;&lt;/span&gt;&lt;span class="pun"&gt;); &amp;lt;----(This is the line I&amp;#39;m running into trouble with)&lt;/span&gt;&lt;span class="pln"&gt;
        &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
        &lt;/span&gt;&lt;span class="kwd"&gt;private&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;AddValue&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;XPathNavigator&lt;/span&gt;&lt;span class="pln"&gt; source&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;XPathNavigator&lt;/span&gt;&lt;span class="pln"&gt; target&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;string&lt;/span&gt;&lt;span class="pln"&gt; sourcePath&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;string&lt;/span&gt;&lt;span class="pln"&gt; targetPath&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
        &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
            target&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;SelectSingleNode&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;targetPath&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;NamespaceManager&lt;/span&gt;&lt;span class="pun"&gt;).&lt;/span&gt;&lt;span class="typ"&gt;SetValue&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;source&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;SelectSingleNode&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;sourcePath&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;NamespaceManager&lt;/span&gt;&lt;span class="pun"&gt;).&lt;/span&gt;&lt;span class="typ"&gt;Value&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
        &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;I&amp;#39;m still new to coding and working my way through as I go, so any help would be appreciated.&lt;/div&gt;&lt;/div&gt;</description></item></channel></rss>