<?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>Browser Forms</title><link>https://www.infopathdev.com:443/forums/40.aspx</link><description>For browser form specific questions</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Submitting Form to a Folder within a Form Library</title><link>https://www.infopathdev.com:443/forums/thread/41722.aspx</link><pubDate>Thu, 14 May 2009 18:11:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41722</guid><dc:creator>mcorbran</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41722.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=41722</wfw:commentRss><description>&lt;p&gt;Hello Forum&lt;/p&gt;
&lt;p&gt;I have the following piece of code used to alter the main submit data connection.&amp;nbsp; This code captures two fields and concatenates them onto the existing submit data connection in order to submit this to the correct folder.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;This works in the InfoPath client, but when publish to SP, we receive an error stating that&amp;nbsp;the submit event handler returned a value indicating that the submit failed.&amp;nbsp; I have tried publishing&amp;nbsp;the form both&amp;nbsp;under Domain and Full Trust and still get the same issue.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Any thoughts??&amp;nbsp; Thanks&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;XPathNavigator xnLocation = xnDoc.SelectSingleNode(&amp;quot;my:myFields/my:DocLibrary&amp;quot;, this.NamespaceManager);&lt;br /&gt;XPathNavigator xnClient = xnDoc.SelectSingleNode(&amp;quot;my:myFields/my:Client&amp;quot;, this.NamespaceManager);&lt;br /&gt;XPathNavigator xnCampaign = xnDoc.SelectSingleNode(&amp;quot;my:myFields/my:CampaignSelection&amp;quot;, this.NamespaceManager);&lt;/p&gt;
&lt;p&gt;FileSubmitConnection fc = (FileSubmitConnection)this.DataConnections[&amp;quot;Main Submit&amp;quot;];&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;fc.FolderUrl = xnLocation.Value + &amp;quot;/&amp;quot; + xnClient.Value + &amp;quot;/&amp;quot; + xnCampaign;&lt;/p&gt;
&lt;p&gt;try&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; fc.Execute();&lt;br /&gt;&amp;nbsp; e.CancelableArgs.Cancel = false;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;catch (Exception ex)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; e.CancelableArgs.Cancel = true;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;</description></item></channel></rss>