<?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: Error - The specified varXmlToEdit value for the View.ExecuteAction call is not valid</title><link>https://www.infopathdev.com:443/forums/thread/20345.aspx</link><pubDate>Mon, 04 Jun 2007 09:18:37 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:20345</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/20345.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=20345</wfw:commentRss><description>&lt;p&gt;Hello Steve and welcome to the forums!&lt;/p&gt;&lt;p&gt;The ExecuteAction() method is shaky at best - it has a lot of dependencies on view state, user context, and a lot of other things.&amp;nbsp; It is usually best to implement these functions on your own. To insert a new row in the repeating section you need to do this:&lt;/p&gt;&lt;ol start="1"&gt;&lt;li&gt;Load the template.xml or sampledata.xml into a IXMLDOMDocument2 object&lt;/li&gt;&lt;li&gt;Select the node that you want to insert, and create clone of it using&amp;nbsp;cloneNode()&lt;/li&gt;&lt;li&gt;On the parent node (the group that contains all of the repeating children), call appendChild() to append the copy of the node from template or sampledata&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Good luck, and let us know if you need any more help!&lt;/p&gt;</description></item><item><title>Error - The specified varXmlToEdit value for the View.ExecuteAction call is not valid</title><link>https://www.infopathdev.com:443/forums/thread/19761.aspx</link><pubDate>Fri, 11 May 2007 00:51:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19761</guid><dc:creator>stpowell</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19761.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=19761</wfw:commentRss><description>&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;Hello All&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;I am new to using InfoPath; however I have com a long was with the help of a couple of books.&lt;span&gt;&amp;nbsp; &lt;/span&gt;I am now to the point that I am trying to write some code to perform a task when I click on a button.&lt;span&gt;&amp;nbsp; &lt;/span&gt;I am using InfoPath 2007; however the template I am modifying must stay in version 2003 and not 2007.&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;What I am trying to do is insert an Item into a repeating table.&lt;span&gt;&amp;nbsp; &lt;/span&gt;This is for an order form and based on the type of order we have some standard entries that are always added.&lt;span&gt;&amp;nbsp; &lt;/span&gt;I plan on have a dropdown box that the sales person will use to select the type of order and then click on a button that will automatically add in the items in to the repeating table.&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;The code that I am trying to use is as follows:&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;Public&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt; QuoteType_Clicked(&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt; sender &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;Object&lt;/span&gt;, &lt;span style="color:blue;"&gt;ByVal&lt;/span&gt; e &lt;span style="color:blue;"&gt;As&lt;/span&gt; ClickedEventArgs)&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;Me&lt;/span&gt;.CurrentView.ExecuteAction(ActionType.XCollectionInsert, &lt;span style="color:maroon;"&gt;&amp;quot;MRC_Items&amp;quot;&lt;/span&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;End Sub&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;When I click on the button I get the following error message&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;System.Runtime.InteropServices.COMException&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;The specified varXmlToEdit value for the View.ExecuteAction call is not valid.&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;at Microsoft.Office.Interop.InfoPath.SemiTrust.View.ExecuteAction(String bstrAction, Object varXmlToEdit)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;at Microsoft.Office.Interop.InfoPath.SemiTrust.ViewObjectWrapper.ExecuteAction(String bstrAction, Object varXmlToEdit)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;at Microsoft.Office.InfoPath.Internal.ViewHost.ExecuteAction(ActionType action, String xmlToEdit)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;at Quote1.FormCode.QuoteType_Clicked(Object sender, ClickedEventArgs e)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;at Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;My Data source is as follows:&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;custForm&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span&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;/span&gt;MRC&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;MRC_Items&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;QtyMRC&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;descriptionMRC&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;UnitCostMRC&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ExtCostMRC&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;WholesaleMRC&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span&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;/span&gt;MRCFilter&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;The MRC is the group and MRC_Items is the repeating table.&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;What am I doing wrong?&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;Thank you all for any help you can give me&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;Steve&lt;/font&gt;&lt;/p&gt;</description></item></channel></rss>