<?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>Controls</title><link>https://www.infopathdev.com:443/forums/43.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Copying Data to Repeating Table in Detail Section</title><link>https://www.infopathdev.com:443/forums/thread/23527.aspx</link><pubDate>Mon, 08 Oct 2007 13:22:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23527</guid><dc:creator>adamrharding</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23527.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=23527</wfw:commentRss><description>&lt;p&gt;Chris&lt;/p&gt;
&lt;p&gt;I think you could do this without code by putting a button on the form defined as rules and custom code that creates a new form but also prepopulates the fields you want so button opens new form and in the form options, save and save as, Rules, and add a rule such that if a new form is opened up set Field A to (last Field A) and so on&lt;/p&gt;
&lt;p&gt;I hope this makes sense as I don&amp;#39;t generally code unless there is no other way around.&lt;/p&gt;
&lt;p&gt;Cheers Adam&lt;/p&gt;</description></item><item><title>Re: Copying Data to Repeating Table in Detail Section</title><link>https://www.infopathdev.com:443/forums/thread/23484.aspx</link><pubDate>Fri, 05 Oct 2007 18:53:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23484</guid><dc:creator>feesh</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23484.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=23484</wfw:commentRss><description>&lt;p&gt;Hi Adam and thanks for your reply. To be a bit more specific about the layout of the form...here is the best way I can present it.&lt;/p&gt;
&lt;p&gt;&amp;lt;Repeating Section&amp;gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;lt;Master&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/Master&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;Detail&amp;gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;lt;Repeat Table1&amp;gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;lt;Repeat Table2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/Repeat Table2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;Repeat Table 3&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/Repeat Table3&amp;gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&amp;lt;/Repeat Table1&amp;gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&amp;lt;/Detail&amp;gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&amp;lt;/Repeating Section&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The repeating sections aren&amp;#39;t really important for this problem since the data in each repeating section is completely independant of each other. The purpose of the master/detail sections is to give the users some versioning ability to the form. The master table is basically just the date, version # and status and the detail section has all the relevant data needed. The issue is that when a new version is created most of the data is the same from the previous version with maybe 1 or 2 modifications. To simplify the process for the user I wanted to copy over the previous versions data to the new version. This was fine for the individual fields inside the detail section that were not part of the repeating table. &lt;/p&gt;
&lt;p&gt;With code I am trying to count the number of times a table has repeated, create a loop based on the number of records and then copy them from the preceding detail section to the current. Since the original posting&amp;nbsp;I found some code online that is suppose to do what I want but it never enters the loops. The code with modifications to fit my example is below. &lt;/p&gt;
&lt;p&gt;The full Xpath for the Colorways_Table&amp;nbsp;is: &amp;nbsp;/my:myFields/my:Domestic_Tab/my:Domestic_Logo/my:Domestic_Logo_Record/my:Domestic_Embroidery_Version/my:Colorways/my:Colorways_Table&lt;/p&gt;
&lt;p&gt;The Xpath for the Detail section is the same up and including my:Domestic_Embroidery_Version.&lt;/p&gt;
&lt;p&gt;var objTable1 = XDocument.DOM.selectNodes(&amp;quot;preceding-sibling::*[1]/my:Colorways/my:Colorways_Table&amp;quot;) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var objXMLNodes; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(var i = 0;i &amp;lt;= objTable1.length - 1;i++) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var objTable2 = XDocument.DOM.selectSingleNode(&amp;quot;//my:Colorways/my:Colorways_Table[last()]&amp;quot;) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(objTable2.selectSingleNode(&amp;quot;my:Colorway_Test&amp;quot;).text != &amp;quot;&amp;quot;) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDocument.View.ExecuteAction(&amp;quot;xCollection::insert&amp;quot;, &amp;quot;Colorways_Table_2&amp;quot;); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var objTable2 = XDocument.DOM.selectSingleNode(&amp;quot;//my:Colorways/my:Colorways_Table[last()]&amp;quot;) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var objT1CurrentRow = objTable1.item(i); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objTable2.selectSingleNode(&amp;quot;my:Colorway_Test&amp;quot;).text = objT1CurrentRow.selectSingleNode(&amp;quot;my:Colorway_Test&amp;quot;).text &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //objTable2.selectSingleNode(&amp;quot;my:field4&amp;quot;).text = objT1CurrentRow.selectSingleNode(&amp;quot;my:field2&amp;quot;).text &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/p&gt;
&lt;p&gt;As I mentioned, no matter how many records I insert it will never go into the loop because objTable1.length keeps returning 0. I know it is very possible I am overlooking something simple as I am quite new to this. If you have any thoughts or advice please let me know. Thanks.&lt;/p&gt;
&lt;p&gt;Chris&lt;/p&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Copying Data to Repeating Table in Detail Section</title><link>https://www.infopathdev.com:443/forums/thread/23464.aspx</link><pubDate>Fri, 05 Oct 2007 07:05:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23464</guid><dc:creator>adamrharding</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23464.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=23464</wfw:commentRss><description>&lt;p&gt;Hi feesh&lt;/p&gt;
&lt;p&gt;What I think you have in group terms is&lt;/p&gt;
&lt;p&gt;Master&lt;/p&gt;
&lt;p&gt;Detail&lt;/p&gt;
&lt;p&gt;Repeat&lt;/p&gt;
&lt;p&gt;Repeat1&amp;nbsp;&amp;nbsp;Repeat 2&lt;/p&gt;
&lt;p&gt;With this structure you say you can successfully copy across the detail section but not the repeating tables.&amp;nbsp; I would presume this is because they are preceding-preceding sibling or indeed preceding-preceding-preceding sibling.&amp;nbsp; I also presume that the first repeating table containing the other two repeating tables do not form part of the detail table as I would presume that they would otherwise copy accross in the preceding sibling.&lt;/p&gt;
&lt;p&gt;Anything else I can help with feel free to ask&lt;/p&gt;
&lt;p&gt;Adam&lt;/p&gt;</description></item><item><title>Copying Data to Repeating Table in Detail Section</title><link>https://www.infopathdev.com:443/forums/thread/23314.aspx</link><pubDate>Thu, 27 Sep 2007 14:37:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23314</guid><dc:creator>feesh</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23314.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=23314</wfw:commentRss><description>&lt;p&gt;Hi Everyone. I am fairly new to infopath but I have managed to teach myself what I think is most of the basics of the program. I have a reached a more complex problem that I need some help with.&lt;/p&gt;
&lt;p&gt;The base of the form consists of a Master and Detail section. Inside the detail section there are a couple of fields and then a Repeating Table that contains 2 more repeating tables inside. I would like all the data from the current detail section to be copied to the new detail section everytime a new master record is inserted. I accomplished this by putting a rule on the insert to copy over the data in the fields using the preceding-sibling function but I am stuck when it comes to the repeating table. Any help would be appreciated.&lt;/p&gt;
&lt;p&gt;I apologize if I wasn&amp;#39;t clear. Let me know if more information is needed. &lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;Chris&lt;/p&gt;</description></item></channel></rss>