<?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: Am I on the right track with ExecuteAction</title><link>https://www.infopathdev.com:443/forums/thread/8814.aspx</link><pubDate>Tue, 17 Jan 2006 04:00:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:8814</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/8814.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=8814</wfw:commentRss><description>Well, sorry we couldn't figure it out through the forum, but I'm glad it's working now.  Greg is quite a whiz.&lt;br /&gt;&lt;br /&gt;Let us know if you have any other questions!&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;InfoPath Dev Texas&lt;br /&gt;</description></item><item><title>Re: Am I on the right track with ExecuteAction</title><link>https://www.infopathdev.com:443/forums/thread/8813.aspx</link><pubDate>Tue, 17 Jan 2006 03:56:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:8813</guid><dc:creator>Ethan</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/8813.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=8813</wfw:commentRss><description>Matt, I gave that a try and got an error indicating something about the action not working on an attribute. Simply because of a very near deadline I had to solicit the professional services of Atonomy Systems. Greg Collins wrote some code that used appendChild and employeed some other methods. I only mention this to provide anyone who reads this thread with as a point of conclusion.&lt;br /&gt;&lt;br /&gt;This forum is absolutely indespensible an thank you agian for your help.&lt;br /&gt;&lt;br /&gt;Ethan @ FuzzyLogic</description></item><item><title>Re: Am I on the right track with ExecuteAction</title><link>https://www.infopathdev.com:443/forums/thread/8812.aspx</link><pubDate>Tue, 17 Jan 2006 01:10:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:8812</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/8812.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=8812</wfw:commentRss><description>If you are using the connection to a database it might be that the nodes you are trying to access are attribute nodes.  This would require you to put a '@' in front of the name to specify them.  Try this:&lt;br /&gt;&lt;br /&gt;var oRow = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:Projects/PrjctTrds/Scores/@Scr");&lt;br /&gt;XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:Projects/PrjctTrds/Scores").appendChild( oRow.cloneNode(false) );&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;InfoPath Dev Texas&lt;br /&gt;</description></item><item><title>Re: Am I on the right track with ExecuteAction</title><link>https://www.infopathdev.com:443/forums/thread/8811.aspx</link><pubDate>Mon, 16 Jan 2006 17:15:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:8811</guid><dc:creator>Ethan</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/8811.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=8811</wfw:commentRss><description>Matt, I was able to get your code to work but only in after I set up a rudimentry test project and I had to change the XPath in the first line to point to a repeating group instead of a field. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;	&lt;br /&gt;var oRow = XDocument.DOM.selectSingleNode("//my:employees/my:employee");&lt;br /&gt;XDocument.DOM.selectSingleNode("//my:employees").appendChild( oRow.cloneNode(false) );&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Unfortunately I haven't found the right XPath in my actual project to make the code work. I've looked up other examples of code that use XPaths but I haven't had any success understanding the logic well enough to apply them to my work.&lt;br /&gt;&lt;br /&gt;If I create a new function, eg OnContextChange, InfoPath writes the XPath of the control you are creating the code for into the comment area. For the control that I need to clone the XPath is "/dfs:myFields/dfs:dataFields/d:Projects/d:PrjctTrds/d:Scores". I tried your suggestion of removing the colons which gave me the same error I've been getting. Endless trial-and-error hasn't yielded any positive results either.&lt;br /&gt;&lt;br /&gt;Do you have any other suggestions on the correct XPath I should be using?&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;&lt;br /&gt;EParker @ FuzzyLogic</description></item><item><title>Re: Am I on the right track with ExecuteAction</title><link>https://www.infopathdev.com:443/forums/thread/8810.aspx</link><pubDate>Sat, 14 Jan 2006 18:05:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:8810</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/8810.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=8810</wfw:commentRss><description>When you get that error it almost always means that your XPath is wrong. When connecting to a database, I don't think you need the d: namespace before every node, so try this:&lt;br /&gt;&lt;br /&gt;var oRow = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:Projects/:PrjctTrds/:Scores/:Scr");&lt;br /&gt;XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:Projects/:PrjctTrds/:Scores").appendChild( oRow.cloneNode(false) );&lt;br /&gt;&lt;br /&gt;If that doesn't work take out the colons in the last three nodes of the first statement and the last two nodes of the second statement.&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;InfoPath Dev Texas&lt;br /&gt;</description></item><item><title>Re: Am I on the right track with ExecuteAction</title><link>https://www.infopathdev.com:443/forums/thread/8809.aspx</link><pubDate>Sat, 14 Jan 2006 05:57:35 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:8809</guid><dc:creator>Ethan</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/8809.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=8809</wfw:commentRss><description>Matt, thanks for your response. I appreciate the help.&lt;br /&gt;I'm getting a run-time error "'null' is null or not an object" with the code you pro recommended. The error is in the second line. I've included it below. I've researching this on my own on MSDN and here but I'm not having any luck. Your wisdom would be much appreciated.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;var oRow = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:Projects/d:PrjctTrds/d:Scores/d:Scr");&lt;br /&gt;XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:Projects/d:PrjctTrds/d:Scores").appendChild( oRow.cloneNode(false) );&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Thanks again,&lt;br /&gt;Ethan&lt;br /&gt;&lt;br /&gt;&lt;blockquote id="quote"&gt;&lt;font size="1" face="Verdana, Arial, Helvetica" id="quote"&gt;quote:&lt;hr height="1" noshade id="quote"&gt;&lt;i&gt;Originally posted by MFaus&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Well your first problem is thinking that you cannot do it, you CAN!&lt;br /&gt;See this code for easily adding a blank row:&lt;br /&gt;&lt;pre&gt;var oRow = XDocument.DOM.selectSingleNode("/my:myFields/my:Table/my:Row");&lt;br /&gt;&lt;br /&gt;XDocument.DOM.selectSingleNode( "/my:myFields/my:Table" ).appendChild( oRow.cloneNode(false) );&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As for running the code after your query finishes - you should be able to simply put the lines of code to insert the blank row underneath the Query() line and it will run after it finishes.  The script doesn't run statements simultaneously, it runs them linearly.&lt;br /&gt;&lt;br /&gt;Hope this helps, let us know if you need any more help!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;InfoPath Dev Texas&lt;br /&gt;&lt;br /&gt;&lt;hr height="1" noshade id="quote"&gt;&lt;/font id="quote"&gt;&lt;/blockquote id="quote"&gt;&lt;br /&gt;&lt;br /&gt;EParker @ FuzzyLogic</description></item><item><title>Re: Am I on the right track with ExecuteAction</title><link>https://www.infopathdev.com:443/forums/thread/8808.aspx</link><pubDate>Fri, 13 Jan 2006 22:46:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:8808</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/8808.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=8808</wfw:commentRss><description>Well your first problem is thinking that you cannot do it, you CAN!&lt;br /&gt;See this code for easily adding a blank row:&lt;br /&gt;&lt;pre&gt;var oRow = XDocument.DOM.selectSingleNode("/my:myFields/my:Table/my:Row");&lt;br /&gt;&lt;br /&gt;XDocument.DOM.selectSingleNode( "/my:myFields/my:Table" ).appendChild( oRow.cloneNode(false) );&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As for running the code after your query finishes - you should be able to simply put the lines of code to insert the blank row underneath the Query() line and it will run after it finishes.  The script doesn't run statements simultaneously, it runs them linearly.&lt;br /&gt;&lt;br /&gt;Hope this helps, let us know if you need any more help!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;InfoPath Dev Texas&lt;br /&gt;</description></item><item><title>Am I on the right track with ExecuteAction</title><link>https://www.infopathdev.com:443/forums/thread/5271.aspx</link><pubDate>Fri, 13 Jan 2006 22:00:29 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:5271</guid><dc:creator>Ethan</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/5271.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=5271</wfw:commentRss><description>As a non-programing newcomer to InfoPath I'm in way over my head with something that appears to be very simple. I need to know if I'm askingt a stupid question or if I'm on the right track. &lt;br /&gt;&lt;br /&gt;I've gone through Introducing MS Office InfoPath and Developing Solutions with MS InfoPath as well as this and other InfoPath forums and sites and found bits and pieces to solve my problem but I can't seem to put them all together.&lt;br /&gt;&lt;br /&gt;Here's my predicament:&lt;br /&gt;&lt;br /&gt;My form queries an Access db and returns a list of subcontractors. After the query results are returned I need to insert a blank row inside a repeating table which is inside the primary repeating table where the subcontractor query results are returned. Asking the user to insert each new row is too cumbersome so I'm trying to do it with code.&lt;br /&gt;&lt;br /&gt;So far I've learned about and experimented with &amp;lt;XDocument.View.ExecuteAction("xCollection::insert","xmlToEdit");&amp;gt; and SelectNodes, and SelectSingleNode which appear to be all that I need. So far I've been unsuccessful at combining them as well as determining how to trigger the code after the query results have been returned. I could use a button but having it work automatically would be better for the user.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Can anyone please help?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Ethan&lt;br /&gt;&lt;br /&gt;EParker @ FuzzyLogic</description></item></channel></rss>