<?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>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Need to automatically add row to a repeating table if &lt;some filed is not blank&gt;</title><link>https://www.infopathdev.com:443/forums/thread/73150.aspx</link><pubDate>Wed, 21 Dec 2011 09:40:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:73150</guid><dc:creator>Brokholm</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/73150.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=73150</wfw:commentRss><description>&lt;p&gt;Hi Jimmy&lt;/p&gt;
&lt;p&gt;I am trying to get this code to work without using a button. I have a repeating table used to keep track of a review process. The table contains 3 fields, a date (date of the review), a result field (drop down) and a rich text box used to include action items/ changes needed for approval.&lt;/p&gt;
&lt;p&gt;The result field (drop down) has 3 possible selections: Unconditional approval, Conditional approval and No approval. If the review ends with no approval I would like to insert a new row in the table to allow planning of a new review. I have previously used alot of sections and then just hidden them unless they were needed because the previous reviews ended with the result: No approval. However this looked a bit messy.&lt;/p&gt;
&lt;p&gt;I can get the code to work as a &amp;quot;Changed event&amp;quot;. However it gets stuck in an infinite loop and inserts 15 lines or so. Could you by chance tell me how this could work?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Best regards&lt;/p&gt;
&lt;p&gt;Dennis&lt;/p&gt;</description></item><item><title>Re: Need to automatically add row to a repeating table if &lt;some filed is not blank&gt;</title><link>https://www.infopathdev.com:443/forums/thread/51131.aspx</link><pubDate>Fri, 29 Jan 2010 05:38:37 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:51131</guid><dc:creator>Hawkeye</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/51131.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=51131</wfw:commentRss><description>&lt;p&gt;Jimmy, Your posts are great resources for the codeless newbie!&lt;/p&gt;
&lt;p&gt;Question, does this work in browser forms and can this be a single line of code added to a button outside of the repeating table?&lt;/p&gt;
&lt;p&gt;I have a complicated senario i&amp;#39;m working through,&amp;nbsp;where I want to use multiple dropdowns and populate one repeating table. (sum of dropdowns if you will).&amp;nbsp; With one button click I would like to take the dropdown field and copy it to the next available line in the repeating table. Similar to the &amp;quot;insert item&amp;quot; command in the table but via a button. Everyone complains about the size of the insert&amp;nbsp;and its not intuitive as a button would be&amp;nbsp;to set the data to the repeating table.&amp;nbsp;The proplem with the current button is it writes to the table but it repeats the entire column. &lt;/p&gt;
&lt;p&gt;Is there a better way to consolidate dropdown selections into one &amp;quot;repository&amp;quot; so I only promote this consolidated table when the form is publised and my work flow only needs to look at one single.&amp;nbsp;multiple lines of text content type.&lt;/p&gt;
&lt;p&gt;Can you follow me?&lt;/p&gt;</description></item><item><title>Re: Need to automatically add row to a repeating table if &lt;some filed is not blank&gt;</title><link>https://www.infopathdev.com:443/forums/thread/39119.aspx</link><pubDate>Tue, 03 Mar 2009 17:29:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:39119</guid><dc:creator>ben.oates</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/39119.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=39119</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;Jimmy:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; 
&lt;p&gt;You can add a row to a repeating table with the following single line of code:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;nbsp;XDocument.View.ExecuteAction(&amp;quot;xCollection::insert&amp;quot;, &amp;quot;&lt;strong&gt;&lt;em&gt;group2_1&lt;/em&gt;&lt;/strong&gt;&amp;quot;)&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;just replace &lt;strong&gt;&lt;em&gt;group2_1&lt;/em&gt;&lt;/strong&gt; with the XMLToEdit value found on the Advanced tab of the repeating table&amp;#39;s properties.&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;When I try this I get the following unhelpful error:&lt;/p&gt;
&lt;p&gt;The following error occured:&lt;/p&gt;
&lt;p&gt;InfoPath has encountered an error. The operation failed.&lt;br /&gt;The form&amp;#39;s code contains an error.&lt;/p&gt;
&lt;p&gt;The following call in the form&amp;#39;s code failed: View.ExecuteAction&lt;br /&gt;Unspecified error&lt;/p&gt;
&lt;p&gt;The line that causes the fault is:&amp;nbsp;&amp;nbsp;XDocument.View.ExecuteAction &amp;quot;xCollection::insert&amp;quot;, &amp;quot;UID_4&amp;quot;&lt;br /&gt;(There are no parenthesis because this form was developed using VBS)&lt;/p&gt;
&lt;p&gt;I have absolutely no idea what this could mean. The only things I can think that might&amp;nbsp;affect it are&amp;nbsp;that I have only just switched to the view when I try to call it... and UID_4 is a repeating section within another repeating section.&lt;/p&gt;</description></item><item><title>Re: Need to automatically add row to a repeating table if &lt;some filed is not blank&gt;</title><link>https://www.infopathdev.com:443/forums/thread/37075.aspx</link><pubDate>Wed, 14 Jan 2009 15:57:32 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37075</guid><dc:creator>shivajidatta</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37075.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=37075</wfw:commentRss><description>Hi Frederik,

I would have gone with your solution but Jimmy&amp;#39;s one liner saves a lot of work :) - lazy that I am!

But thanks a lot anyways! Really appreciate it.</description></item><item><title>Re: Need to automatically add row to a repeating table if &lt;some filed is not blank&gt;</title><link>https://www.infopathdev.com:443/forums/thread/37074.aspx</link><pubDate>Wed, 14 Jan 2009 15:54:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37074</guid><dc:creator>shivajidatta</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37074.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=37074</wfw:commentRss><description>BULLS EYE!!!

Thanks for this line Jimmy... it has been a huuuge help!!!</description></item><item><title>Re: Need to automatically add row to a repeating table if &lt;some filed is not blank&gt;</title><link>https://www.infopathdev.com:443/forums/thread/37055.aspx</link><pubDate>Wed, 14 Jan 2009 10:48:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37055</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37055.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=37055</wfw:commentRss><description>&lt;p&gt;You can add a row to a repeating table with the following single line of code:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;nbsp;XDocument.View.ExecuteAction(&amp;quot;xCollection::insert&amp;quot;, &amp;quot;&lt;strong&gt;&lt;em&gt;group2_1&lt;/em&gt;&lt;/strong&gt;&amp;quot;)&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;just replace &lt;strong&gt;&lt;em&gt;group2_1&lt;/em&gt;&lt;/strong&gt; with the XMLToEdit value found on the Advanced tab of the repeating table&amp;#39;s properties.&lt;/p&gt;</description></item><item><title>Re: Need to automatically add row to a repeating table if &lt;some filed is not blank&gt;</title><link>https://www.infopathdev.com:443/forums/thread/37051.aspx</link><pubDate>Wed, 14 Jan 2009 10:18:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37051</guid><dc:creator>Frederik Van Lierde</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37051.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=37051</wfw:commentRss><description>&lt;div class="ForumPostContentText"&gt;&lt;font color="#008080" size="2"&gt;
&lt;p&gt;You need to access this Manifest file, the following line shows how to&amp;nbsp;get e newRow node&amp;nbsp;&lt;/p&gt;
&lt;p&gt;XPathNavigator&lt;/font&gt;&lt;font size="2"&gt; xnNode = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;font size="2"&gt;.Template.Manifest.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;//xsf:xDocumentClass/xsf:views/xsf:view/xsf:editing/xsf:xmlToEdit[@name=&amp;#39;&lt;strong&gt;NameNodeInManifest&lt;/strong&gt;&amp;#39;]/xsf:editWith/xsf:fragmentToInsert/xsf:chooseFragment/my:&lt;strong&gt;RepeatingNode&lt;/strong&gt;&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;font size="2"&gt;.NamespaceManager);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&amp;nbsp;So first you &lt;strong&gt;Save as source file, &lt;/strong&gt;go to the manifest:xsf en try to find the &lt;font color="#800000"&gt;&lt;strong&gt;NameNodeInManifest, &lt;/strong&gt;This will be the nodename with a number&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font color="#800000"&gt;After the first part of the code, append the new structure, when you delete the complete range, InfoPath doesn&amp;#39;t know the structure anymore&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;
&lt;p&gt;xnGroupNode.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:expenseReport/my:MyControls&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;font size="2"&gt;.NamespaceManager).AppendChild(xnNode.InnerXml);&lt;/font&gt;&lt;/p&gt;&lt;font color="#008000" size="2"&gt;
&lt;p&gt;//-- Get the newest appended node --&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;xnNewRow = xn.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:expenseReport/my:MyControls/my:MyControl[last()]&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;font size="2"&gt;.NamespaceManager);&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;
&lt;p&gt;// Add the data to the new row&amp;nbsp;&lt;br /&gt;xnNewRow.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;my:Source&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;font size="2"&gt;.NamespaceManager).SetValue(&amp;quot;some data&amp;quot;)&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;Hope this will help you&lt;/p&gt;&lt;/div&gt;</description></item><item><title>Need to automatically add row to a repeating table if &lt;some filed is not blank&gt;</title><link>https://www.infopathdev.com:443/forums/thread/37043.aspx</link><pubDate>Tue, 13 Jan 2009 22:24:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37043</guid><dc:creator>shivajidatta</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37043.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=37043</wfw:commentRss><description>The following code (on click of a button) works perfectly for me to delete a row from a repeating table :

var thisNode = eventObj.Source.selectSingleNode(&amp;quot;.&amp;quot;);
thisNode.parentNode.removeChild(thisNode)

I need something exactly like this but which will ADD an row to a repeating table.  Clicking the&amp;quot; Insert Item&amp;quot; or button is not an option.  Basically I want to add a row to a repeating table as soon as some other field (not a part of the repeating table) is populated.  If it can be done without code, even better!!!

Can you help me please?

Infopath 2003 and JScript.</description></item></channel></rss>