<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/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>Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx</link><description>Have you ever needed to develop an InfoPath form template that submits back to a SharePoint document library but you did not initially know the server or library name when developing the form? Or have a scenario where your InfoPath form template could</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>SharePoint Connections – Sessions Follow Up</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1073224</link><pubDate>Tue, 14 Nov 2006 09:04:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1073224</guid><dc:creator>Todd Baginski's SharePoint 2003 and MOSS 2007 Blog</dc:creator><description>&lt;p&gt;First of all I would like to say THANK YOU to everyone who came to my sessions last week! I had a wonderful...&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1082399</link><pubDate>Wed, 15 Nov 2006 23:54:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1082399</guid><dc:creator>fordhamSteve</dc:creator><description>&lt;p&gt;I think you are missing this line of code from your Submit event:&lt;/p&gt;
&lt;p&gt;FileSubmitConnection fc = (FileSubmitConnection)this.DataConnections[&amp;quot;Main submit&amp;quot;];&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1093854</link><pubDate>Fri, 17 Nov 2006 16:11:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1093854</guid><dc:creator>Scott Heim</dc:creator><description>&lt;p&gt;Hi fordhamSteve,&lt;/p&gt;
&lt;p&gt;Thank you for alerting us to the missing line of code - the sample has now been corrected.&lt;/p&gt;
&lt;p&gt;Scott Heim&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1094417</link><pubDate>Fri, 17 Nov 2006 18:52:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1094417</guid><dc:creator>dlgross</dc:creator><description>&lt;p&gt;I am getting the following error when i try to preview my form. I have limited experience with javascript.&lt;/p&gt;
&lt;p&gt;Any idea what I might have done wrong? Thanks, Dean&lt;/p&gt;
&lt;p&gt;InfoPath cannot open the selected form because of an error in the form's code.&lt;/p&gt;
&lt;p&gt;The following error occurred:&lt;/p&gt;
&lt;p&gt;Expected ';'&lt;/p&gt;
&lt;p&gt;File:script.js&lt;/p&gt;
&lt;p&gt;Line:8&lt;/p&gt;
&lt;p&gt;private object _strUri &lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1094801</link><pubDate>Fri, 17 Nov 2006 20:17:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1094801</guid><dc:creator>Scott Heim</dc:creator><description>&lt;p&gt;Hi Dean,&lt;/p&gt;
&lt;p&gt;Most likely the cause of this problem is the fact that this code is C#.NET and not JScript. If you want to test using the same form and C#, you will need to remove the JScript code first and then set the form to use C#:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; - Open the XSN in Design View&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; - From the Tools menu choose Form Options&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; - Select the Programming Category&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; - Click the Remove Code button to remove the JScript files&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; - From the Form Template Code Language box choose C#&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1095469</link><pubDate>Fri, 17 Nov 2006 23:40:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1095469</guid><dc:creator>dlgross</dc:creator><description>&lt;p&gt;Scott, thanks, When I look at the Form Options, Advanced tab, there is no Programming Category, there is only a Programming Language box with Form Code Language choices of JScript and VB Script. I'm using IP 2003 SP1. How do I make it use C#?&lt;/p&gt;
&lt;p&gt;Dean&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1095980</link><pubDate>Sat, 18 Nov 2006 01:15:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1095980</guid><dc:creator>Scott Heim</dc:creator><description>&lt;p&gt;Ah - 2003...that's a bit different. Do you need to use this form or can you start over with a new form? Either way, you will need to use the Visual Studio Tools for Office InfoPath Toolkit (in conjunction with Visual Studio) to create a managed code solution. If you don't have Visual Studio then the only code options available are JScript and VBScript and you will need to convert the C# code to JScript.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1097691</link><pubDate>Sat, 18 Nov 2006 05:38:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1097691</guid><dc:creator>dlgross</dc:creator><description>&lt;p&gt;I was just testing your approach to see how it would work in a dummy form before I tried to implement it in an existing form. I do have VS 2003 with the toolkit. Would it be worthwhile to get VS 2005 if this is the only coding that I'm doing?&lt;/p&gt;
&lt;p&gt;Dean&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1116421</link><pubDate>Tue, 21 Nov 2006 21:01:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1116421</guid><dc:creator>Scott Heim</dc:creator><description>&lt;p&gt;Hi Dean,&lt;/p&gt;
&lt;p&gt;Certainly there are some benefits to moving to VS2005 but although I have not tried it, theoretically the same basic process/code should work using the managed code option with VS2003.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1116565</link><pubDate>Tue, 21 Nov 2006 21:28:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1116565</guid><dc:creator>dlgross</dc:creator><description>&lt;p&gt;Scott, is this supposed to work with IP 2003 or 2007? I keep getting compile errors in 2003.&lt;/p&gt;
&lt;p&gt;Dean&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1116600</link><pubDate>Tue, 21 Nov 2006 21:37:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1116600</guid><dc:creator>Scott Heim</dc:creator><description>&lt;p&gt;Hey Dean,&lt;/p&gt;
&lt;p&gt;Although that code is C#, it is specific to the new object model in 2007. To get this to work in 2003, you will need to convert that code to the 2003 object model.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1123174</link><pubDate>Wed, 22 Nov 2006 21:12:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1123174</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;By popular demand, Scott converted the code used in this article into the InfoPath 2003 managed object model (in C#) and into JScript. You can download the full listing in the attachments section above. &lt;/p&gt;
&lt;p&gt;Alex&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1160390</link><pubDate>Mon, 27 Nov 2006 20:16:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1160390</guid><dc:creator>dlgross</dc:creator><description>&lt;p&gt;Thanks for making the conversions Scott, I'm getting closer to getting this to work, but I don't have a Digital Certificate. Is there any workaround available? Dean&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1160507</link><pubDate>Mon, 27 Nov 2006 21:06:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1160507</guid><dc:creator>Scott Heim</dc:creator><description>&lt;p&gt;Hi Dean,&lt;/p&gt;
&lt;p&gt;Glad you hear you are making headway! For testing purposes, you can create a &amp;quot;self-cert&amp;quot; (basically a certificate that does not have a chain of trust, hence it is only valid on the machine in which it was created) by choosing the Create Certificate button in Tools | Form Options | Security and Trust category.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1439709</link><pubDate>Tue, 09 Jan 2007 19:56:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1439709</guid><dc:creator>nemegeerm</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;When I add the code strUri = thisXDocument.Solution.URI; to get the url I get a uniform resource identifier (urn:eLNDTX:Innx). Am I missing something ? Why don't I get a url ??&lt;/p&gt;
&lt;p&gt;Marc&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1439825</link><pubDate>Tue, 09 Jan 2007 20:16:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1439825</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Marc,&lt;/p&gt;
&lt;p&gt;How are you testing? Did you deploy the form to your SharePoint site? Also - did you &amp;quot;install&amp;quot; this form on the the client machine?&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1442829</link><pubDate>Wed, 10 Jan 2007 10:02:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1442829</guid><dc:creator>nemegeerm</dc:creator><description>&lt;p&gt;Hi Scott,&lt;/p&gt;
&lt;p&gt;Yes, I deployed to a sharepoint site and installed this form on my client machine on the development environment. In production I have a certificate so that I don't have to install the form on the client machines. I attached VS to the infopath process, put a break in the on load and filled out a new form and inspected the contents of the variable.&lt;/p&gt;
&lt;p&gt;Thanks for your input,&lt;/p&gt;
&lt;p&gt;Marc&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1443814</link><pubDate>Wed, 10 Jan 2007 15:51:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1443814</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Marc,&lt;/p&gt;
&lt;p&gt;When you install a form template, then the code that I supplied as a sample is returning the correct data: it is the Uri of the installed form - not from the SharePoint doc lib. I would suspect that is most cases, if you deploy a form template to SharePoint, you will not be &amp;quot;installing&amp;quot; it to the client machines. (Hence, I did not test for this scenario.) If you needed to install the template on your dev machine just for testing purposes then you can simply create a &amp;quot;self-cert&amp;quot; and use this instead. &lt;/p&gt;
&lt;p&gt;In short - to test the sample code, you will need to uninstall your form.&lt;/p&gt;
&lt;p&gt;Let me know if this works for you! &lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1450132</link><pubDate>Thu, 11 Jan 2007 13:32:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1450132</guid><dc:creator>nemegeerm</dc:creator><description>&lt;p&gt;Scott,&lt;/p&gt;
&lt;p&gt;I installed the office 2003 certification support, created a certificate, signed my compiled infopath template with it and last but not least deployed the form to my sharepoint document library.&lt;/p&gt;
&lt;p&gt;1) The url problem is solved. I get the nice url that I was looking for ...&lt;/p&gt;
&lt;p&gt;2) When I try to submit, I can't submit because my certificate is not from a trusted authority, which makes sense to me because I generated it. &lt;/p&gt;
&lt;p&gt;And of course my full development environment is on one machine, a virtual one but that does not matter. It's a 2003 with Sharepoint services, visual studio, infopath, etc.&lt;/p&gt;
&lt;p&gt;I get the following error:&lt;/p&gt;
&lt;p&gt;InfoPath cannot submit the form.&lt;/p&gt;
&lt;p&gt;An error occurred while the form was being submitted.&lt;/p&gt;
&lt;p&gt;InfoPath cannot load this form. The signature on this form is not from a trusted publisher.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at Microsoft.Office.Interop.InfoPath.SemiTrust.DAVAdapter.Submit()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at Microsoft.Office.Interop.InfoPath.SemiTrust.DAVAdapterObjectWrapper.Submit()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at Microsoft.Office.Interop.InfoPath.SemiTrust.DAVAdapterObjectWrapper.Submit()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at eLNSolution.eLNSolution.DoSave() in c:\documents and settings\administrator\my documents\visual studio projects\elnsolution\formcode.cs:line 420&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at eLNSolution.eLNSolution.OnSubmitRequest(DocReturnEvent e) in c:\documents and settings\administrator\my documents\visual studio projects\elnsolution\formcode.cs:line 357&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_SinkHelper.OnSubmitRequest(DocReturnEvent pEvent)&lt;/p&gt;
&lt;p&gt;Am I missing something ?&lt;/p&gt;
&lt;p&gt;Marc&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1450638</link><pubDate>Thu, 11 Jan 2007 16:40:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1450638</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Marc,&lt;/p&gt;
&lt;p&gt;I am a bit confused I think: are you using InfoPath 2003 or 2007? (You mentioned certificate support from 2003.) Also - you set the secuity level of the form template to Full Trust - correct?&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1450877</link><pubDate>Thu, 11 Jan 2007 18:31:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1450877</guid><dc:creator>nemegeerm</dc:creator><description>&lt;p&gt;Scott,&lt;/p&gt;
&lt;p&gt;I'm using Infopath 2003 with C# code for the form.&lt;/p&gt;
&lt;p&gt;The security level is full-trust (managed code). THat's the reason why I install the form on my development machine. I production, there is a certificate.&lt;/p&gt;
&lt;p&gt;Marc&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1451599</link><pubDate>Thu, 11 Jan 2007 22:44:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1451599</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Marc,&lt;/p&gt;
&lt;p&gt;Thank you for the clarification. When you launch the InfoPath form from your SharePoint library, do you see a security prompt with options to Open , Trust this Publisher, etc.?&lt;/p&gt;
&lt;p&gt;I do all of my testing with a Self-Cert and this process works for; however, I do see this prompt when I launch the form. I choose Open (not Always Trust) and the submit works as well.&lt;/p&gt;
&lt;p&gt;If you do not see this prompt, try this for me:&lt;/p&gt;
&lt;p&gt;- Open your XSN in Design View&lt;/p&gt;
&lt;p&gt;- From the Tools menu choose Form Options&lt;/p&gt;
&lt;p&gt;- Select the Security tab&lt;/p&gt;
&lt;p&gt;- Click the Create Certificate button to create a new certificate&lt;/p&gt;
&lt;p&gt;- Select this new cert as the cert to sign the XSN&lt;/p&gt;
&lt;p&gt;- Re-publish and test&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1471011</link><pubDate>Mon, 15 Jan 2007 15:23:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1471011</guid><dc:creator>nemegeerm</dc:creator><description>&lt;p&gt;Scott,&lt;/p&gt;
&lt;p&gt;Yes I see the form. I click the always trust and then yes.&lt;/p&gt;
&lt;p&gt;I tried first with the &amp;quot;create certificate&amp;quot; in Infopath. Deployed and tested. WORKS&lt;/p&gt;
&lt;p&gt;I tried again with the other certificate. Deployed and tested. It WORKS also.&lt;/p&gt;
&lt;p&gt;Gues I've done something wrong last week ...&lt;/p&gt;
&lt;p&gt;Thanks for your support,&lt;/p&gt;
&lt;p&gt;Marc&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1471053</link><pubDate>Mon, 15 Jan 2007 15:46:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1471053</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Thanks for letting me know Marc - I am certainly glad you were able to get this working! &lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1478162</link><pubDate>Tue, 16 Jan 2007 14:50:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1478162</guid><dc:creator>ivl</dc:creator><description>&lt;p&gt;Hi Scott,&lt;/p&gt;
&lt;p&gt;Thank you for posting this - I have been looking for such a solution for a LONG time.&lt;/p&gt;
&lt;p&gt;This solves one of my two problems.&lt;/p&gt;
&lt;p&gt;The second problem is related:&lt;/p&gt;
&lt;p&gt;Is it possible to have a receive location that is dynamic? I have an InfoPath 2007 form which receives data from a SharePoint list (to populate a drop down) and would like the server name part of the url to be dynamic.&lt;/p&gt;
&lt;p&gt;I have tried doing this using the following code:&lt;/p&gt;
&lt;p&gt;SharepointListQueryConnection mylist = (SharepointListQueryConnection)this.DataConnections[&amp;quot;mylist&amp;quot;];&lt;/p&gt;
&lt;p&gt;mylist.SiteUrl = new Uri(&amp;quot;&lt;a rel="nofollow" target="_new" href="http://otherserver/TheList&amp;quot;"&gt;http://otherserver/TheList&amp;quot;&lt;/a&gt;);&lt;/p&gt;
&lt;p&gt;but the SiteUrl property is read-only.&lt;/p&gt;
&lt;p&gt;Is there any way to do this?&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1489017</link><pubDate>Thu, 18 Jan 2007 19:19:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1489017</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Sorry for the delay in getting back to you on this. Unfortunately, I don't see a way to accomplish this as there are no methods to update these values.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1490275</link><pubDate>Thu, 18 Jan 2007 23:44:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1490275</guid><dc:creator>derrickgh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt; &amp;nbsp;I am using InfoPath 2003 and SharePoint v2. I was able to use the solution above on a test form and work perfectly. &lt;/p&gt;
&lt;p&gt;Now when I try to add this code to the forms I have in production Iam getting a compiling error &amp;quot; 'null' is null or not an object File: script.js Line:92&amp;quot;&lt;/p&gt;
&lt;p&gt;Line 92 is &amp;quot;xnFormURL.text = strUri;&lt;/p&gt;
&lt;p&gt;These forms are also conected to a SQL DB backend, not sure if that could be causing the problem. Any assistance in getting this to work would be greatly appreciated. Thanks! &lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#1494353</link><pubDate>Fri, 19 Jan 2007 22:33:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1494353</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It sounds like your xnFormURL object is null - which is typically caused by an invalid XPath expression to that node. &lt;/p&gt;
&lt;p&gt;You will need to step through your code and make sure the XPath expression is correct.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>SharePoint Connections – Sessions Follow Up</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#2437033</link><pubDate>Sun, 06 May 2007 04:36:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2437033</guid><dc:creator>Todd Baginski's SharePoint 2003 and MOSS 2007 Blog</dc:creator><description>&lt;p&gt;First of all I would like to say THANK YOU to everyone who came to my sessions last week! I had a wonderful&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#2655642</link><pubDate>Tue, 15 May 2007 22:46:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2655642</guid><dc:creator>shirinp</dc:creator><description>&lt;p&gt;One scenario that I have had trouble with is if you publish the form as a content type on the site collection. In that situation, the form is published under the site collection url, not the form library url. &lt;/p&gt;
&lt;p&gt;I set a document library under that site collection to manage content types and I select the content type to be the one that was published using infopath. When I click new on the document library and select that content type, it opens the form in the infopath client. However, I'm unable to capture the form library url that I was in. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;How can I capture that url so that I can use it to change the path of the submit dynamically?&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#2672562</link><pubDate>Wed, 16 May 2007 16:19:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2672562</guid><dc:creator>Scott Heim</dc:creator><description>&lt;p&gt;Hi shirinp,&lt;/p&gt;
&lt;p&gt;Unfortunately I have not found a way around this...other than displaying the form in the browser instead of the client. This should allow you to capture the form library URL. If you must open it in the client and have it published as a site content type, I know of no way to capture this information.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#3120758</link><pubDate>Wed, 06 Jun 2007 19:48:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3120758</guid><dc:creator>zullu</dc:creator><description>&lt;p&gt;Hi Scott,&lt;/p&gt;
&lt;p&gt;I have tried the attached solution for Infopath 2007 C# code.&lt;/p&gt;
&lt;p&gt;I am getting an error: &amp;quot;System.ArgumentOutOfRangeException, Length cannot be less than zero.&amp;quot;&lt;/p&gt;
&lt;p&gt;- in the PopulateLibInfo function at the line where you are trying to Parse the path to doc library to return something like: &lt;a rel="nofollow" target="_new" href="http://server/library"&gt;http://server/library&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;strPath = strUri.Substring(0, strUri.IndexOf(&amp;quot;Forms&amp;quot;) - 1);&lt;/p&gt;
&lt;p&gt;When I look at the value returning from strUri.IndexOf(&amp;quot;Forms&amp;quot;), I can see it is returning &amp;quot;-1&amp;quot;.&lt;/p&gt;
&lt;p&gt;Am I going wrong somewhere!&lt;/p&gt;
&lt;p&gt;Thanks in advance for any kind of help.&lt;/p&gt;
&lt;p&gt;zullu.&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#3121105</link><pubDate>Wed, 06 Jun 2007 19:59:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3121105</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi zullu,&lt;/p&gt;
&lt;p&gt;Where did you publish the form and how are you trying to open it?&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#3147751</link><pubDate>Thu, 07 Jun 2007 23:14:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3147751</guid><dc:creator>BobC</dc:creator><description>&lt;p&gt;shirinp,&lt;/p&gt;
&lt;p&gt;Just so you know, you are not alone regarding this problem...&lt;/p&gt;
&lt;p&gt;I also tried passing a parameter indicating the location, but wss doesn't allow parms to be set for a content type. &amp;nbsp;Unless Scott has an idea for this.&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#3149176</link><pubDate>Fri, 08 Jun 2007 01:01:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3149176</guid><dc:creator>BobC</dc:creator><description>&lt;p&gt;I get prompted for the file name. &amp;nbsp;How do I set this in code?&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#3163901</link><pubDate>Fri, 08 Jun 2007 17:58:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3163901</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi BobC,&lt;/p&gt;
&lt;p&gt;You would typically use a field in the data source to store the name of the submitted form. So you can either set this using a Rule or use code similar to the following:&lt;/p&gt;
&lt;p&gt;XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();&lt;/p&gt;
&lt;p&gt;XPathNavigator xnFormName = xnDoc.SelectSingleNode(&amp;quot;/my:myFields/my:formNameField&amp;quot;, this.NamespaceManager);&lt;/p&gt;
&lt;p&gt;xnFormName.SetValue(&amp;quot;Form1&amp;quot;);&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#3955511</link><pubDate>Thu, 19 Jul 2007 16:44:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3955511</guid><dc:creator>pkarpati</dc:creator><description>&lt;p&gt;I've tried to call this.Submit() method with your sample code in my own Button Clicked event, but the Forms Server tell me that I cannot call XmlForm.Submit in a SubmitEventHandler.&lt;/p&gt;
&lt;p&gt;I want to do this because I need to call Rules before Submit in your way.&lt;/p&gt;
&lt;p&gt;Can you help me?&lt;/p&gt;
&lt;p&gt;Peter&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#3963139</link><pubDate>Fri, 20 Jul 2007 01:00:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3963139</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi pkarpati,&lt;/p&gt;
&lt;p&gt;You have a couple of options:&lt;/p&gt;
&lt;p&gt;- Change your button to simply be a &amp;quot;Submit&amp;quot; button (don't use code)&lt;/p&gt;
&lt;p&gt;- Use the click event of the button to call the same code that is in the &amp;quot;Submit&amp;quot; event and remove the Submit event handler. &lt;/p&gt;
&lt;p&gt;NOTE: if you use the 2nd option, you will &amp;nbsp;need to remove the &amp;quot;e.CancelableArgs&amp;quot; lines.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#4011614</link><pubDate>Mon, 23 Jul 2007 19:39:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4011614</guid><dc:creator>RChakravarti</dc:creator><description>&lt;p&gt;Hello Scott, &lt;/p&gt;
&lt;p&gt;I have a question, regarding using CODE to save the form instance to a subfolder that only an admin can see. &lt;/p&gt;
&lt;p&gt;USE CASE: &lt;/p&gt;
&lt;p&gt;========&lt;/p&gt;
&lt;p&gt; &amp;nbsp; Once a user enters a form (such as a survey in WSS3, through a web enabled InfoPath form), the user should not be able to re-open OR read any other entries by other people. &lt;/p&gt;
&lt;p&gt;We thought we could have a folder called &amp;quot;Submitted&amp;quot; in the WSS library, where the form could be saved using the &amp;quot;SaveLocation&amp;quot; QueryString property, and that this folder could only be permissioned to be viewable by &amp;quot;Admins&amp;quot;. &lt;/p&gt;
&lt;p&gt;ISSUE:&lt;/p&gt;
&lt;p&gt;=====&lt;/p&gt;
&lt;p&gt;Even when we used SPSecurity.RunWithElevatedPrivileges(), &amp;nbsp;we get an access denied for anyone NOT AUTHORIZED to see the &amp;quot;Submitted&amp;quot; subfolder. We are unable to fgiure out why.. When logged on as admin, the save works just fine.&lt;/p&gt;
&lt;p&gt;---------------&lt;/p&gt;
&lt;p&gt; public void FormEvents_Submit(object sender, SubmitEventArgs e)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SPSecurity.RunWithElevatedPrivileges(delegate()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Get a reference to the submit data connection&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FileSubmitConnection fc = (FileSubmitConnection)this.DataConnections[&amp;quot;Main submit&amp;quot;];&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Modify the URL we want to submit to by concatenating the &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// xnLocation and xnFolderName values&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;fc.FolderUrl = &amp;quot;&lt;a rel="nofollow" target="_new" href="http://servername:3000/sites/testsite/Feedback/Submitted&amp;quot;;"&gt;http://servername:3000/sites/testsite/Feedback/Submitted&amp;quot;;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Execute the submit connection&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;try&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;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;fc.Execute();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;e.CancelableArgs.Cancel = false;&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;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;catch (Exception ex)&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;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;e.CancelableArgs.Cancel = true;&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;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;});&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;---------------&lt;/p&gt;
&lt;p&gt;NOTE: &lt;/p&gt;
&lt;p&gt; a) The form library is called &amp;quot;Feedback&amp;quot; with a subfolder &amp;quot;Submitted&amp;quot; which has Admin Rights only.&lt;/p&gt;
&lt;p&gt;b) Users instantiate a form instance through a custom link which has the SaveLocation QueryString param pointing to the (hidden) &amp;quot;Submitted&amp;quot; folder, with the desired behaviour of them not being able to see the form once submitted.&lt;/p&gt;
&lt;p&gt;Any help you can provide would be great. &lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Rajiv&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#4048304</link><pubDate>Wed, 25 Jul 2007 22:26:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4048304</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Rajiv,&lt;/p&gt;
&lt;p&gt;There is no built-in InfoPath functionality to limit the forms a user can see once submitted. You could create a custom SharePoint &amp;quot;View&amp;quot; that uses the &amp;quot;[Me]&amp;quot; filter to limit what documents they see when they open that library; however, this is not &amp;quot;security&amp;quot; per s&amp;#233; just a filter. &lt;/p&gt;
&lt;p&gt;Regarding the permissions not working - I believe you would be better served by asking this of the SharePoint group.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#5026269</link><pubDate>Fri, 21 Sep 2007 09:25:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5026269</guid><dc:creator>Neelesh Kalani</dc:creator><description>&lt;p&gt;I am also facing the same problem as Shirinp. In my case, i upload the form to the form server and then activate it to a particular sitecollection.&lt;/p&gt;
&lt;p&gt;of cNow i have a number child sites in tht sitecollection which will use this form content type, so i need to find a way to get the URL of the form library at run time. Ofcourse this post solves the problem for the forms that are opened using the browser but what to do in case forms are opened using Infopath?&lt;/p&gt;
&lt;p&gt;Have anybody got the solution for the problem ?&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#5118048</link><pubDate>Tue, 25 Sep 2007 13:58:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5118048</guid><dc:creator>Neelesh Kalani</dc:creator><description>&lt;p&gt;Also, I am able to submit the new form using this method, but how can i resubmit or save the same form when it is opened in edit mode.&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#5144369</link><pubDate>Wed, 26 Sep 2007 16:36:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5144369</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Neelesh,&lt;/p&gt;
&lt;p&gt;If I understand correctly you are asking how to open an existing form from a library, modify it and then re-save it using the same name - correct? If so, then when you setup the &amp;quot;submit&amp;quot; data connection make sure you enable the option: Allow overwrite if file exists.&amp;quot;&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#5159003</link><pubDate>Thu, 27 Sep 2007 06:48:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5159003</guid><dc:creator>Neelesh Kalani</dc:creator><description>&lt;p&gt;Hi Scott,&lt;/p&gt;
&lt;p&gt;Thanks for replying.&lt;/p&gt;
&lt;p&gt;Is there any wrok around for my first problem?&lt;/p&gt;
&lt;p&gt;Also, i need to add data (at run time) to a repeating table which has two columns, one consisting of checkbox and the other has text box.&lt;/p&gt;
&lt;p&gt;Can you pass on some links.....&lt;/p&gt;
&lt;p&gt;Also, is it okay to use Sharepoint object model directly in infopath code ?&lt;/p&gt;
&lt;p&gt;Neelesh&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#5167034</link><pubDate>Thu, 27 Sep 2007 15:44:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5167034</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Neelesh,&lt;/p&gt;
&lt;p&gt;As I have mentioned a couple of times before, there is no way that I know of to get this information.&lt;/p&gt;
&lt;p&gt;Regarding adding data at runtime, since this is a repeating node you will want to use code to accomplish this. There are a number of ways this can be done: append the new row as I am dong below or if you want to extract the form files you can get the actual &amp;quot;OuterXml&amp;quot; of the node you want to append and use this to append the row or if this is a client-only form you can use the &amp;quot;ExecuteAction&amp;quot; method to add a new row.&lt;/p&gt;
&lt;p&gt;The following sample assumes the following:&lt;/p&gt;
&lt;p&gt;- A secondary data connection to the SQL Server Northwind Shippers table - this connection is called Shippers&lt;/p&gt;
&lt;p&gt;- A Repeating Table with 3 columns: f1_ID, f2_CompanyName and f3_Phone&lt;/p&gt;
&lt;p&gt;- On the Loading event of the form, I populate those repeating table fields using the following code:&lt;/p&gt;
&lt;p&gt;public void FormEvents_Loading(object sender, LoadingEventArgs e)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Create a NamespaceManager to use when referencing namespaces&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;XmlNamespaceManager ns = this.NamespaceManager;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Create an XPathNavigator object for the main DOM&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Create an XPathNavigator object for the Repeating Table node&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;XPathNavigator xnRepeatingTable = xnDoc.SelectSingleNode(&amp;quot;/my:myFields/my:group1&amp;quot;, ns);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Create a DataSource object for our secondary data connection&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DataSource dsShippers = this.DataSources[&amp;quot;Shippers&amp;quot;];&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Create an XPathNavigator object for the data source&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;XPathNavigator xnShippers = dsShippers.CreateNavigator();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Create an XPathNodeIterator object so we can enumerate all the records from the&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//secondary data connection&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;XPathNodeIterator xiShippers = xnShippers.Select(&amp;quot;/dfs:myFields/dfs:dataFields/d:Shippers&amp;quot;, ns);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Loop through those records&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while (xiShippers.MoveNext())&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Create string variables for all the fields we need to populate&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//in the Repeating table&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string strID = xiShippers.Current.SelectSingleNode(&amp;quot;@ShipperID&amp;quot;, ns).Value;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string strCompanyName = xiShippers.Current.SelectSingleNode(&amp;quot;@CompanyName&amp;quot;, ns).Value;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string strPhone = xiShippers.Current.SelectSingleNode(&amp;quot;@Phone&amp;quot;, ns).Value;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Use the AppendChild method to add a new row to the repeating table and &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//concatenate each field value appropriately&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xnRepeatingTable.AppendChild(&amp;quot;&amp;lt;my:group2&amp;gt;&amp;lt;my:f1_ID&amp;gt;&amp;quot; + strID + &amp;quot;&amp;lt;/my:f1_ID&amp;gt;&amp;lt;my:f2_CompanyName&amp;gt;&amp;quot; + strCompanyName + &amp;quot;&amp;lt;/my:f2_CompanyName&amp;gt;&amp;lt;my:f3_Phone&amp;gt;&amp;quot; + strPhone + &amp;quot;&amp;lt;/my:f3_Phone&amp;gt;&amp;lt;/my:group2&amp;gt;&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Cleanup&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ns = null;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xnDoc = null;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xnRepeatingTable = null;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dsShippers = null;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xnShippers = null;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xiShippers = null;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;I hope this helps!&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#5399384</link><pubDate>Thu, 11 Oct 2007 11:48:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5399384</guid><dc:creator>Neelesh Kalani</dc:creator><description>&lt;p&gt;Many Thanks for the suggestions.&lt;/p&gt;
&lt;p&gt;That worked perfectly.&lt;/p&gt;
&lt;p&gt;If some one also wish to clear the repeating tables befor filling them...following code will be useful:&lt;/p&gt;
&lt;p&gt;string NodeGroup = /my:myFields/my:group7/my:openTable&amp;quot;;&lt;/p&gt;
&lt;p&gt;XPathNavigator FirstNode = MainDataSource.CreateNavigator().SelectSingleNode(NodeGroup + &amp;quot;[1]&amp;quot;, NamespaceManager);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;XPathNavigator LastNode = MainDataSource.CreateNavigator().SelectSingleNode(NodeGroup + &amp;quot;[position()=last()]&amp;quot;, NamespaceManager);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(FirstNode != null)&lt;/p&gt;
&lt;p&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;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (LastNode != null)&lt;/p&gt;
&lt;p&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; &lt;/p&gt;
&lt;p&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;FirstNode.DeleteRange(LastNode);&lt;/p&gt;
&lt;p&gt; &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else&lt;/p&gt;
&lt;p&gt; &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FirstNode.DeleteSelf();&lt;/p&gt;
&lt;p&gt; &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#5399494</link><pubDate>Thu, 11 Oct 2007 11:58:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5399494</guid><dc:creator>Neelesh Kalani</dc:creator><description>&lt;p&gt;I have one more query.&lt;/p&gt;
&lt;p&gt;One of the field in the repeating table is a date field and i am populating it from sharepoint list. it shows me the validating screentip &amp;quot;Only Date allowed&amp;quot;.&lt;/p&gt;
&lt;p&gt;I have not applied any validation and also the date which i am filling in the date filed is in the same format as specified for that field.&lt;/p&gt;
&lt;p&gt;I also tried to delete the nil attribute but still no luck.&lt;/p&gt;
&lt;p&gt;Any clues...&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#5401222</link><pubDate>Thu, 11 Oct 2007 16:11:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5401222</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi neelesh,&lt;/p&gt;
&lt;p&gt;Here is some sample code that works for me - in this case, &amp;quot;field1&amp;quot; has a &amp;quot;Date&amp;quot; data type:&lt;/p&gt;
&lt;p&gt;XmlNamespaceManager ns = this.NamespaceManager;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;XPathNavigator xnDateField = xnDoc.SelectSingleNode(&amp;quot;/my:myFields/my:field1&amp;quot;, ns);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Remove the &amp;quot;nil&amp;quot; attribute&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (xnDateField.MoveToAttribute(&amp;quot;nil&amp;quot;, &amp;quot;&lt;a rel="nofollow" target="_new" href="http://www.w3.org/2001/XMLSchema-instance&amp;quot;"&gt;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&lt;/a&gt;))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xnDateField.DeleteSelf();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xnDateField.SetValue(&amp;quot;2007-10-12&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ns = null;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xnDoc = null;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xnDateField = null;&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#5414826</link><pubDate>Fri, 12 Oct 2007 08:15:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5414826</guid><dc:creator>Neelesh Kalani</dc:creator><description>&lt;p&gt;Hi Scott,&lt;/p&gt;
&lt;p&gt;I have already tried the same code, but it does not works.&lt;/p&gt;
&lt;p&gt;In my case, i am first adding the row to the repeating table at run time using the code:&lt;/p&gt;
&lt;p&gt; xnRepeatingTable.AppendChild(&amp;quot;&amp;lt;my:group2&amp;gt;&amp;lt;my:MyDate&amp;gt;&amp;lt;/my:MyDate&amp;gt;&amp;lt;/my:group2&amp;gt;&amp;quot;);&lt;/p&gt;
&lt;p&gt;Where, MyDate is the date field which is initialy empty and also not having any nil attribute.&lt;/p&gt;
&lt;p&gt;After this i wrote the code to remove the nil attribute and set the value of the date field which is as follows:&lt;/p&gt;
&lt;p&gt;XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XPathNavigator xnDateField = xnDoc.SelectSingleNode&amp;quot;/my:myFields/my:group1/my:group2&amp;quot; + &amp;quot;[&amp;quot; + Index of the row+ &amp;quot;]&amp;quot; + &amp;quot;/my:MyDate&amp;quot;, ns);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Remove the &amp;quot;nil&amp;quot; attribute&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (xnDateField.MoveToAttribute(&amp;quot;nil&amp;quot;, &amp;quot;&lt;a rel="nofollow" target="_new" href="http://www.w3.org/2001/XMLSchema-instance&amp;quot;"&gt;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&lt;/a&gt;))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xnDateField.DeleteSelf();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xnDateField.SetValue(&amp;quot;2007-10-12&amp;quot;);&lt;/p&gt;
&lt;p&gt;But it still showing me the same error.&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#5461315</link><pubDate>Mon, 15 Oct 2007 15:35:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5461315</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi neelesh,&lt;/p&gt;
&lt;p&gt;And just to confirm, your date field is a node in your &amp;quot;main&amp;quot; DOM - correct? And if you look at the properties for this node, the data type is set to &amp;quot;Date (date)&amp;quot; - correct?&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#5510323</link><pubDate>Thu, 18 Oct 2007 19:41:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5510323</guid><dc:creator>Neelesh Kalani</dc:creator><description>&lt;p&gt;Yes, That is correct.&lt;/p&gt;
&lt;p&gt;And i am getting the error when the date field is empty.&lt;/p&gt;
&lt;p&gt;I am trying to insert a blank string in a field after delting the nil vallue.&lt;/p&gt;
&lt;p&gt;I don't know how to insert blank date in the field.&lt;/p&gt;
&lt;p&gt;Neelesh&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#5510464</link><pubDate>Thu, 18 Oct 2007 19:50:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5510464</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Neelesh,&lt;/p&gt;
&lt;p&gt;I am confused: in your prior response, you advised you tried the code I supplied, which actually inserts a date, failed for you. Is this correct? If you actually specify a date in the code it fails? Or does it only fail if you try to insert a blank date? (If only when inserting a blank date, why do you want to insert a blank date??)&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#5640708</link><pubDate>Wed, 24 Oct 2007 07:26:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5640708</guid><dc:creator>Neelesh Kalani</dc:creator><description>&lt;p&gt;Hi Scott,&lt;/p&gt;
&lt;p&gt;If i use the following code to add the date field then it shows the error &amp;quot;can not blank&amp;quot;, while i have not used any validations.&lt;/p&gt;
&lt;p&gt;xnRepeatingTable.AppendChild(&amp;quot;&amp;lt;my:group2&amp;gt;&amp;lt;my:MyDate&amp;gt;&amp;lt;/my:MyDate&amp;gt;&amp;lt;/my:group2&amp;gt;&amp;quot;);&lt;/p&gt;
&lt;p&gt;Neelesh&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#5649678</link><pubDate>Wed, 24 Oct 2007 16:10:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5649678</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Neelesh,&lt;/p&gt;
&lt;p&gt;Can you please complete these steps and let me know the results:&lt;/p&gt;
&lt;p&gt;- Create a new, blank form template&lt;/p&gt;
&lt;p&gt;- Add a Repeating Table with just 2 columns&lt;/p&gt;
&lt;p&gt;- Change the name of the text box in column 1 to: textField&lt;/p&gt;
&lt;p&gt;- Change the name of the text box in column 2 to: dateField&lt;/p&gt;
&lt;p&gt;- Your data source should look like this:&lt;/p&gt;
&lt;p&gt;myFields&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; group1&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;group2&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; textField&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dateField&lt;/p&gt;
&lt;p&gt;- Change the data type of dateField to: Date (date)&lt;/p&gt;
&lt;p&gt;- Add a button to the View&lt;/p&gt;
&lt;p&gt;- Add the following code to the click event of the button:&lt;/p&gt;
&lt;p&gt;XmlNamespaceManager ns = this.NamespaceManager;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;XPathNavigator xnTable = xnDoc.SelectSingleNode(&amp;quot;/my:myFields/my:group1&amp;quot;, ns);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xnTable.AppendChild(&amp;quot;&amp;lt;my:group2&amp;gt;&amp;lt;my:textField&amp;gt;Test&amp;lt;/my:textField&amp;gt;&amp;lt;my:dateField&amp;gt;&amp;lt;/my:dateField&amp;gt;&amp;lt;/my:group2&amp;gt;&amp;quot;);&lt;/p&gt;
&lt;p&gt;- Test - when I execute this code, the new row is added and by default, the dateField field will be required.&lt;/p&gt;
&lt;p&gt;Does this work for you?&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#5660867</link><pubDate>Thu, 25 Oct 2007 07:04:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5660867</guid><dc:creator>Neelesh Kalani</dc:creator><description>&lt;p&gt;This is what the problem is...I do not want the date field to be made required BY DEFAULT.&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#5666934</link><pubDate>Thu, 25 Oct 2007 15:25:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5666934</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi neelesh,&lt;/p&gt;
&lt;p&gt;Sorry about that - I guess that was the part I was not understanding. Modify the &amp;quot;AppendChild&amp;quot; line as follows:&lt;/p&gt;
&lt;p&gt;xnTable.AppendChild(&amp;quot;&amp;lt;my:group2&amp;gt;&amp;lt;my:textField&amp;gt;Test&amp;lt;/my:textField&amp;gt;&amp;lt;my:dateField xsi:nil='true'&amp;gt;&amp;lt;/my:dateField&amp;gt;&amp;lt;/my:group2&amp;gt;&amp;quot;);&lt;/p&gt;
&lt;p&gt;As you can see, I have added the attribute &amp;quot;xsi:nil='true'&amp;quot; to that line of code. This allows for a blank value and insures the field is not required.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#5778248</link><pubDate>Tue, 30 Oct 2007 12:16:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5778248</guid><dc:creator>Brian111</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;This worked great thanks.&lt;/p&gt;
&lt;p&gt;Is it possible to use this technique on data connections ?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Brian&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#5784628</link><pubDate>Tue, 30 Oct 2007 21:51:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5784628</guid><dc:creator>scorphg</dc:creator><description>&lt;p&gt;Is there a solution like this for vb? &amp;nbsp;Here is my issue. &amp;nbsp;I have a shrepoint library which is/will be storing many documents.&lt;/p&gt;
&lt;p&gt;I wrote a infopath form that needs to submit the new document(s) to the sharepoint site. &amp;nbsp;I cannot use the default submit because of the need to organize the documents into specific locations/folders. &amp;nbsp;Once the form is completed, i have a field which has the &amp;quot;save as&amp;quot; filled in as well as the location with the appropriate url and folder. &amp;nbsp;so the question is how to submit to sharepoint server for this scenario. &amp;nbsp;The other scenario is &amp;quot;old&amp;quot; documents. &amp;nbsp;Those which have already been saved... how do I get the actual filename for the document, then proceed to overwrite it if any changes are made? &amp;nbsp;Is there a method which I can extract the url, filename, location/folder??&lt;/p&gt;
&lt;p&gt;thanks in advance&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#5805051</link><pubDate>Thu, 01 Nov 2007 00:16:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5805051</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Brian,&lt;/p&gt;
&lt;p&gt;Not sure I follow - are you asking if you can append data to secondary data connections in this manner? &lt;/p&gt;
&lt;p&gt;Hi scorphg,&lt;/p&gt;
&lt;p&gt;For the submit part of your question, that is what this post basically does: allow you to specify the submit location at runtime. Am I misunderstanding what you are asking?&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#5962625</link><pubDate>Wed, 07 Nov 2007 18:34:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5962625</guid><dc:creator>scorphg</dc:creator><description>&lt;p&gt;Hi Scott,&lt;/p&gt;
&lt;p&gt;Thanks for the very quick response. &amp;nbsp;I dont think you are misunderstanding the question, as much as I may not be stating it correctly. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Basically, the question is how do i get the filename of an existing form saved to sharepoint using vb managed code?&lt;/p&gt;
&lt;p&gt;The c# code above is great, and I will use that for future projects, so thanks... is there the same code for vb managed code?&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#6276545</link><pubDate>Fri, 16 Nov 2007 01:14:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6276545</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi scorphg,&lt;/p&gt;
&lt;p&gt;Sorry for the delay - it has been quite busy. You would need to parse the Uri I believe but unfortunately I don't have any sample code for any of this in VB. &lt;/p&gt;
&lt;p&gt;If I get some time, I'll see what I can come up with.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#6431803</link><pubDate>Tue, 20 Nov 2007 15:57:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6431803</guid><dc:creator>Neelesh Kalani</dc:creator><description>&lt;p&gt;How can we populate a drop down using c# code?&lt;/p&gt;
&lt;p&gt;I need to set both the value and the display names and also need to read those vales and display name back.&lt;/p&gt;
&lt;p&gt;Right now i am only able to fill the values.&lt;/p&gt;
&lt;p&gt;Any suggesstions?&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#6456917</link><pubDate>Wed, 21 Nov 2007 18:45:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6456917</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi neelesh,&lt;/p&gt;
&lt;p&gt;As you have probably seen, you do not have programmatic access to controls in InfoPath. What you would need to do is either populate a repeating structure in the main DOM that the dropdown is bound to or populate an XML resource file that is used as the source of data for the dropdown or use a web service to retrieve the data.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#6634701</link><pubDate>Sat, 01 Dec 2007 23:49:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6634701</guid><dc:creator>boverton</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;This code works great for the initial submit. &amp;nbsp;But when editing an existing document I get errors. &amp;nbsp;5537 &amp;nbsp; Any suggestions? &amp;nbsp;I think the URLs are different for a new document submit and an edit&lt;/p&gt;
&lt;p&gt;cheers,&lt;/p&gt;
&lt;p&gt;Brad&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#6882421</link><pubDate>Fri, 28 Dec 2007 09:12:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6882421</guid><dc:creator>moss_sharepoint</dc:creator><description>&lt;p&gt;Though this query does not belong to this blog, still I am posting it here as this is a very critical requirement in one of our projects.&lt;/p&gt;
&lt;p&gt;Is there some way to convert the browser enabled infopath 2007 file saved in the form library to pdf/word document programmatically?&lt;/p&gt;
&lt;p&gt;We have a windows service which will send these converted pdf/word files as an attachment in the email. &lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#6958058</link><pubDate>Wed, 02 Jan 2008 22:17:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6958058</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Brad,&lt;/p&gt;
&lt;p&gt;I was finally able to get to the issue of opening and submitting an existing form and I did need to modify the code. This updated sample code is a bit verbose but I wanted to show the various steps. Here are the updates:&lt;/p&gt;
&lt;p&gt;- Replace the sample Loading event code with the following:&lt;/p&gt;
&lt;p&gt;// See if the form was opened in the browser&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Boolean OpenedInBrowser = Application.Environment.IsBrowser;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Variables to store the results of testing if the form&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//being opened is new and if not, the &amp;quot;source&amp;quot; location&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//parameter so we can get the server or server/site name&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Boolean newForm = true;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string strSource = string.Empty;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Get the Uri (or SaveLocation/XmlLocation in a browser form) of where &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// the form was opened.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (OpenedInBrowser)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (this.New) //We will get the SaveLocation parameter&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_strUri = e.InputParameters[&amp;quot;SaveLocation&amp;quot;].ToString();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else //We will get the XmlLocation parameter&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;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_strUri = e.InputParameters[&amp;quot;XmlLocation&amp;quot;].ToString();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;newForm = false;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Store the &amp;quot;Source&amp;quot; parameter so we can parse this for&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//the server/site URL&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strSource = e.InputParameters[&amp;quot;Source&amp;quot;].ToString();&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;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else //Opened in the client&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//See if we are opening a new form - if so, we will get the &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Uri to the template&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (this.New)&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;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_strUri = this.Template.Uri.ToString();&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;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else&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;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//If opening an existing form, we will get the Uri&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//of the form we are opening.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_strUri = this.Uri;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;newForm = false;&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;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Populate the fields on the form - keep in mind, this&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// not necessary - this is simply to see the results&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PopulateLibInfo(OpenedInBrowser, newForm, strSource);&lt;/p&gt;
&lt;p&gt;- Replace the sample PopulateLibInfo procedure with this one:&lt;/p&gt;
&lt;p&gt;private void PopulateLibInfo(Boolean OpenedInBrowser, Boolean newForm, string strSourceParam)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Create a Navigator object for the main DOM&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Create Navigator objects for each field&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;XPathNavigator xnFormURL = xnDoc.SelectSingleNode(&amp;quot;my:myFields/my:strFormURL&amp;quot;, this.NamespaceManager);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;XPathNavigator xnLocation = xnDoc.SelectSingleNode(&amp;quot;my:myFields/my:strLocation&amp;quot;, this.NamespaceManager);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;XPathNavigator xnFolderName = xnDoc.SelectSingleNode(&amp;quot;my:myFields/my:strFolderName&amp;quot;, this.NamespaceManager);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Get the Uri stored in the FormState Dictionary variable&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string strUri = _strUri.ToString();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Create a variable to store the path (URL) to the document library&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string strPath = &amp;quot;&amp;quot;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (OpenedInBrowser == true)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (newForm)&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;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//If we are open in the browser, the strUri value is just&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//the server name and library - so we just need to get &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//the URL without the last &amp;quot;/&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strPath = strUri.Substring(0, strUri.LastIndexOf(&amp;quot;/&amp;quot;));&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;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else&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;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//We need to get the server URL (up to the library name) so&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//we can successfully submit the form.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string strServer = string.Empty;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//The following is broken into 2 parts so it is easier to see&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//what we need to do:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Get the URL up to the word &amp;quot;Forms&amp;quot; in the URL&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strServer = strSourceParam.Substring(0, strSourceParam.IndexOf(&amp;quot;Forms&amp;quot;));&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Get the URL up to the last &amp;quot;/&amp;quot; before &amp;quot;Forms&amp;quot; - this will be&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//the server or server/site&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strServer = strServer.Substring(0, strServer.LastIndexOf(&amp;quot;/&amp;quot;));&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strPath = strServer + strPath;&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;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else //Opened in the client&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Parse just the path to the document library - &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// this would return something like this:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// &amp;nbsp;&lt;a rel="nofollow" target="_new" href="http://server/library"&gt;http://server/library&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//NOTE: This process will not work when an ADMIN deployed form&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//is opened in the client.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;try&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;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strPath = strUri.Substring(0, strUri.IndexOf(&amp;quot;Forms&amp;quot;) - 1);&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;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;catch { }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Now, parse the URL to where the document library resides;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// this would return something like: &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// &lt;a rel="nofollow" target="_new" href="http://server or"&gt;http://server or&lt;/a&gt; &lt;a rel="nofollow" target="_new" href="http://server/site"&gt;http://server/site&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string strLoc = strPath.Substring(0, strPath.LastIndexOf(&amp;quot;/&amp;quot;));&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Lastly, parse the URL to return just the document library name - &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// in this case,we are looking for the last &amp;quot;/&amp;quot; character &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// knowing that what comes after this is the document library name&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string strFolder = strPath.Substring(strPath.LastIndexOf(&amp;quot;/&amp;quot;) + 1);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Populate the fields on the form – we will use these &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// values in the Submit process&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xnFormURL.SetValue(strUri);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xnLocation.SetValue(strLoc);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xnFolderName.SetValue(strFolder);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;With these changes, you should be able to open and submit either a new or existing form. &lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#7201556</link><pubDate>Tue, 22 Jan 2008 23:32:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7201556</guid><dc:creator>derrickgh</dc:creator><description>&lt;p&gt;I was able to get this work when creating a blank template but could not get it to work using a form that is connected to a SQL DB. The error I get when opening the form from SharePoint is: &lt;/p&gt;
&lt;p&gt;&amp;quot;System.NullReferenceException&lt;/p&gt;
&lt;p&gt;Object reference not set to an instance of an object.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at Template13.FormCode.PopulateLibInfo()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at Template13.FormCode.FormEvents_OnLoad(DocReturnEvent e)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_SinkHelper.OnLoad(DocReturnEvent pEvent)&amp;quot;&lt;/p&gt;
&lt;p&gt;Will this solution work with a form that is created for a SQL DB? Thanks! &lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#7202457</link><pubDate>Wed, 23 Jan 2008 01:43:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7202457</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi derrickgh,&lt;/p&gt;
&lt;p&gt;Yes - this will work when your form template has been created from a database; however, the XPATH will be different for the fields you create in this sample. For instance, the strLocation node in this sample has an XPATH of: my:myFields/my:strLocation. However, when your form is created from a database connection, the XPATH is now: /dfs:myFields/my:group1/my:strLocation.&lt;/p&gt;
&lt;p&gt;It sounds as if you may not have the correct XPATH referenced. If you are using InfoPath 2007, simply right-click on each node that you have referenced in your code and choose Copy XPath. Then paste this into your code and compare.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#7209323</link><pubDate>Wed, 23 Jan 2008 18:04:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7209323</guid><dc:creator>derrickgh</dc:creator><description>&lt;p&gt;Thanks Scott that worked!! &lt;/p&gt;
&lt;p&gt;One last question. The forms I need to use this on use a search functionality, so once the form is the person finds their project in a drop-down hits search and this populates the form, which in turn clears the 3 fields used for this solution. Is there a way to run the code after the search event? Thanks again for your help&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#7210244</link><pubDate>Wed, 23 Jan 2008 19:40:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7210244</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi derrickgh,&lt;/p&gt;
&lt;p&gt;The fields that store the folder name, location, etc. - are these in your database table as well?&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#7210298</link><pubDate>Wed, 23 Jan 2008 19:45:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7210298</guid><dc:creator>derrickgh</dc:creator><description>&lt;p&gt;Scott,&lt;/p&gt;
&lt;p&gt; Yes, the 3 fields are in DB table. &lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#7210336</link><pubDate>Wed, 23 Jan 2008 19:50:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7210336</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi derrickgh,&lt;/p&gt;
&lt;p&gt;OK - then you can either move the code to populate these to the submit code or (the easier option) remove those fields from the database and simply add them to your datasource. Unless I am missing something from your design needs, these fields are not required to be in the database. You can display the Data Source Task Pane, right-click on the &amp;quot;myFields&amp;quot; node and choose Add. Then simply add these 3 fields. Now these will not get submitted to the database table but that should not be needed.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#7212332</link><pubDate>Wed, 23 Jan 2008 23:55:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7212332</guid><dc:creator>derrickgh</dc:creator><description>&lt;p&gt;I moved the code under the submit button and it works perfectly. Thanks again for your help! &lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#7219499</link><pubDate>Thu, 24 Jan 2008 13:08:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7219499</guid><dc:creator>dkarantonis</dc:creator><description>&lt;p&gt;Hi Scott,&lt;/p&gt;
&lt;p&gt;nice article.&lt;/p&gt;
&lt;p&gt;I have an InfoPath form created in order to be used as a workflow association form.&lt;/p&gt;
&lt;p&gt;I would like to retrieve the list that the workflow is (about to be) associated from the InfoPath form's FormLoad event code.&lt;/p&gt;
&lt;p&gt;When the association form is loaded from the web browser (through InfoPath form services), the url is &amp;quot;&lt;a rel="nofollow" target="_new" href="http://vmserver/development/Company1/_layouts/CstWrkflIP.aspx?List="&gt;http://vmserver/development/Company1/_layouts/CstWrkflIP.aspx?List=&lt;/a&gt;{345EB1D6-434E-4CA9-9138-823CB320AD6C}&amp;quot;.&lt;/p&gt;
&lt;p&gt;How can i get this List ID?&lt;/p&gt;
&lt;p&gt;When using the e.InputParameters[&amp;quot;SaveLocation&amp;quot;], i get the following exception &amp;quot;The given key was not present in the dictionary.&amp;quot;&lt;/p&gt;
&lt;p&gt;How can i get the URL?&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#7222513</link><pubDate>Thu, 24 Jan 2008 17:26:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7222513</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi dkarantonis,&lt;/p&gt;
&lt;p&gt;In this scenario, the &amp;quot;List&amp;quot; parameter is not an &amp;quot;InputParameter&amp;quot; to the form. If you debug this you will see the InputParameter count is zero. I have been unable to find a way to get this from behind the InfoPath form - so you may want to look at trying to get the URL and parsing it from the ASPX page.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#7223405</link><pubDate>Thu, 24 Jan 2008 18:46:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7223405</guid><dc:creator>dkarantonis</dc:creator><description>&lt;p&gt;Hi Scott&lt;/p&gt;
&lt;p&gt;i finally got through it by adding a System.Web reference to my project and retreiving the list GUID from the url by using the HttpContext.Current.Request.QueryString[&amp;quot;List&amp;quot;].ToString() command.&lt;/p&gt;
&lt;p&gt;I don't know if this is the best way to handle this issue, but it did work for me. If there is a better way, please let me know.&lt;/p&gt;
&lt;p&gt;thanks for the support&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#7345857</link><pubDate>Thu, 31 Jan 2008 12:37:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7345857</guid><dc:creator>dkarantonis</dc:creator><description>&lt;p&gt;Hi Scott,&lt;/p&gt;
&lt;p&gt;do you have any idea about how i could programmatically retreive the workflow association name from inside the form's code at runtime (the workflow association name is not known at design time? Is it something i could get also from the aspx page?&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#7350372</link><pubDate>Thu, 31 Jan 2008 16:28:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7350372</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi dkarantonis,&lt;/p&gt;
&lt;p&gt;Unfortunately I do not - your best bet would probably be to post that query to a workflow forum or you could open a support case with the SharePoint folks.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8032089</link><pubDate>Tue, 04 Mar 2008 21:42:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8032089</guid><dc:creator>boverton</dc:creator><description>&lt;p&gt;Hello Scott, &lt;/p&gt;
&lt;p&gt;quick question. &amp;nbsp;In reference to your answer &lt;/p&gt;
&lt;p&gt;# re: Submitting to 'this' document library &lt;/p&gt;
&lt;p&gt;Thursday, July 19, 2007 6:00 PM by infopath &lt;/p&gt;
&lt;p&gt;In reference to putting this code behind a button. &amp;nbsp; I need to be able to run Rules first and then submit. &amp;nbsp; This works fine but I can't get my document to Close when submitted. &amp;nbsp; I have close document in the submit options but I don't think they are being called because you're going directly thru the Data connection. &amp;nbsp; Is there a way to close the form after your submit code?&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8051947</link><pubDate>Wed, 05 Mar 2008 16:56:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8051947</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi boverton,&lt;/p&gt;
&lt;p&gt;The easiest way is to simply add a Rule to the same button where you are executing code and the Rule will have just one action: Close the form.&lt;/p&gt;
&lt;p&gt;The code should execute to submit the form and then close.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8680173</link><pubDate>Wed, 02 Jul 2008 08:33:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8680173</guid><dc:creator>mehtavipulk</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have a InfoPath form with VSTA code embedded to it. In InfoPath development mode, we attach the project file to the .xsn form. So while &amp;nbsp;publishing the form the .xsn form compiles the project file (in to a .dll file). But how do we manage this situation in the production enviornment? If we try to publish the form (using File -&amp;gt; Publish option of the InfoPath form), using VSTA it will start searching for the project file &amp;amp; try to compile it. But in the production enviornment there wont be Visual Studio installed to map the project file &amp;amp; compile it while publishing the form.&lt;/p&gt;
&lt;p&gt;In the production enviornment how do we manage to publish InfoPath form with with embedded VSTA code?&lt;/p&gt;
&lt;p&gt; Regards,&lt;/p&gt;
&lt;p&gt;Vipul Mehta&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8681156</link><pubDate>Wed, 02 Jul 2008 14:30:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8681156</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Vipul,&lt;/p&gt;
&lt;p&gt;As you know, when you compile the VSTA code behind your InfoPath form template (XSN file), the compiled DLL becomes part of the XSN. You are correct that each time you publish we attempt to compile the code; however, when you publish on a machine that does not have the project files you can simply click &amp;quot;Ignore&amp;quot; and the publish process will continue. (Obviously the other option, since you have InfoPath on that machine is to simply copy the project files to that computer and then when you get that message click the 'Browse' button to locate the project file.)&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8854772</link><pubDate>Wed, 13 Aug 2008 03:38:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8854772</guid><dc:creator>svarukala</dc:creator><description>&lt;p&gt;Scott,&lt;/p&gt;
&lt;p&gt;Firstly, thanks for a very useful post. We are implementing around 100 forms in SharePoint and you sample code helps a lot to make the form submission independent of the form library.&lt;/p&gt;
&lt;p&gt;However, I am having a problem with updating the existing form. I got your latest code you wrote in your comments which will updated an already existing form. I got it working but it has one glitch. The program is raising 'unauthorized exception' unless I use an account with full rights(owner). The user who created the form, is als not able to update it. I worked around it by calling the data connection submit call within SPSecurity.RunWithElevatedPrivileges block. But here is the problem, the sharepoint library columns 'Created By' and 'Modified By' are populated with 'System Account' or the admin account name instead of the current user name.&lt;/p&gt;
&lt;p&gt;So, is there any other work around for this? or Are we missing anything? Is there any explanation for this behaviour(user not able to update)? Thanks for your help.&lt;/p&gt;
&lt;p&gt;-Srinivas&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8857852</link><pubDate>Wed, 13 Aug 2008 15:15:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8857852</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Srinivas,&lt;/p&gt;
&lt;p&gt;I had not heard this before so I just tried this on my test site and it seems to work correctly. My &amp;quot;TestUser&amp;quot; has Contribute permissions to my site - I then logged on as that user, created and submitted a new form and then successfully opened that same form, modified data and re-submitted. In this test, the form shows Modified By: TestUser.&lt;/p&gt;
&lt;p&gt;What you may want to look at is doing a Netmon or Fiddler trace to see if you can track down down the cause of the failure - obviously remove your workaround code. :)&lt;/p&gt;
&lt;p&gt;Offhand I cannot think of a reason why...do you have your form set to Full Trust?&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8858487</link><pubDate>Wed, 13 Aug 2008 17:19:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8858487</guid><dc:creator>irgendwo</dc:creator><description>&lt;p&gt;Hi Scott,&lt;/p&gt;
&lt;p&gt;My problem is that by clicking the button in infopath form published on sharepoint site i should open existing form that resides in infopath forms library and one of it's fields should match certain value.How could i do that?Neither i found the opportunity to get the full url of existing form nor the opportunity to request the form with desired field value.&lt;/p&gt;
&lt;p&gt;Will be grateful for any help.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vitaly.&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8861362</link><pubDate>Thu, 14 Aug 2008 00:51:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8861362</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Vitaly,&lt;/p&gt;
&lt;p&gt;I am not sure I completely follow the issue but it sounds like you want to open an InfoPath form based on either command-line or query (URL) parameters...is this correct? If so - have you seen these:&lt;/p&gt;
&lt;p&gt;How to: Use Query Parameters to Invoke Browser-Enabled InfoPath Forms&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://msdn2.microsoft.com/en-us/library/ms772417.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms772417.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Command-line switches for InfoPath&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://office.microsoft.com/en-us/infopath/HP101483281033.aspx"&gt;http://office.microsoft.com/en-us/infopath/HP101483281033.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8863415</link><pubDate>Thu, 14 Aug 2008 05:27:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8863415</guid><dc:creator>svarukala</dc:creator><description>&lt;p&gt;Scott,&lt;/p&gt;
&lt;p&gt;Thanks for your reply. I just tried copying your code as it is and it worked just fine. Even a user with just the contribute access is able to add and update a form. I will retest the same in my other problematic environment at my work place. I will let you know the result.&lt;/p&gt;
&lt;p&gt;In between, I wonder if a form can be published once and deployed into multipe environments (development, staging, production)? As of now its not possible because we have to give the URL to the sharepoint site to which we publish and so it is hardwired to the form. Technically, I agree that might not be possible because we digitally sign the form for a particular environment. But with a wild card certificate this should not be a problem right?&lt;/p&gt;
&lt;p&gt;Thx,&lt;/p&gt;
&lt;p&gt;Srinivas&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8866113</link><pubDate>Thu, 14 Aug 2008 13:07:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8866113</guid><dc:creator>irgendwo</dc:creator><description>&lt;p&gt;Hi Scott&lt;/p&gt;
&lt;p&gt;Thanks for reply.&lt;/p&gt;
&lt;p&gt;After looking through these articles I still haven't found the way to open the form with desired value in certain field.It should be made via some CAML query or what?&lt;/p&gt;
&lt;p&gt;Thanks in advance&lt;/p&gt;
&lt;p&gt;Vitaly&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8866476</link><pubDate>Thu, 14 Aug 2008 14:47:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8866476</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Srinivas - I am glad to hear the sample works as needed! In regard to publishing once - the answer could be &amp;quot;maybe.&amp;quot; &amp;lt;G&amp;gt; Let me explain: If your various sites (dev, prod, etc.) are in the same farm then you could &amp;quot;Admin&amp;quot; deploy the form and then activate it to the appropriate site collections. If your various sits are not under the same farm, you could still perform the &amp;quot;Admin&amp;quot; publish and then simply move that published form where needed and then complete the Admin process of uploading and activating to the appropriate site collection. &lt;/p&gt;
&lt;p&gt;Keep in mind, either of these would still require the solution in this post but the process is indeed possible. The other thing you would need to consider though are data connections. Now again, you may be able to cover this with code but you do need to keep it in mind.&lt;/p&gt;
&lt;p&gt;Vitaly - Unless I am missing something, what you would need to do is open the 2nd form using a command-line or query parameter and then you would have code in the &amp;quot;Loading&amp;quot; event that looked for that parameter and populated the appropriate field (node) in the form.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8866480</link><pubDate>Thu, 14 Aug 2008 14:48:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8866480</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Vitaly - here is one more item on command-line/query parameters that may help:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/infopath/archive/2007/02/26/passing-data-into-a-form-input-parameters.aspx"&gt;http://blogs.msdn.com/infopath/archive/2007/02/26/passing-data-into-a-form-input-parameters.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8866714</link><pubDate>Thu, 14 Aug 2008 16:29:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8866714</guid><dc:creator>irgendwo</dc:creator><description>&lt;p&gt;Hi Scott&lt;/p&gt;
&lt;p&gt;The thing is that the 2nd form is not always the same.It's different every time and depends on the data in 1st form.So i think that this problem could be solved using SPQuery class from SharePoint OM.By doing so we can select what existing form to open by making the query.Could we somehow use this class in InfoPath?We should add some using directive or assembly reference?&lt;/p&gt;
&lt;p&gt;Thanks for your help&lt;/p&gt;
&lt;p&gt;Vitaly&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8866784</link><pubDate>Thu, 14 Aug 2008 16:50:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8866784</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Vitaly,&lt;/p&gt;
&lt;p&gt;Yes - you can use this in your InfoPath manged code...note that you will need to develop this on your server machine. &lt;/p&gt;
&lt;p&gt;You will need to add a Reference to Windows SharePoint Services and then a &amp;quot;using&amp;quot; directive: using Microsoft.SharePoint;&lt;/p&gt;
&lt;p&gt;Once you have these in place in your managed code, you can then use the SharePoint OM.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8867252</link><pubDate>Thu, 14 Aug 2008 19:31:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8867252</guid><dc:creator>svarukala</dc:creator><description>&lt;p&gt;Scott, I got it working today. I still don't know what was the mistake I was doing. But the good the thing is its working now. &lt;/p&gt;
&lt;p&gt;Regarding the publishing once, I thought a form has to be published separately for each target site. I will give a try if I can deploy a form which was published to a Dev site into QA site. We have different server farm for different environments. For the data connections I am using UDC's, so, that is taken care of. All the forms are fully trusted, admin published forms.&lt;/p&gt;
&lt;p&gt;Srinivas&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8876395</link><pubDate>Mon, 18 Aug 2008 16:11:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8876395</guid><dc:creator>irgendwo</dc:creator><description>&lt;p&gt;Hi Scott&lt;/p&gt;
&lt;p&gt;Thanks for your help but i've got another question..i've decided to make my template browser-enabled but thus some methods of Application class,such as NewFromFormTemplate disappeared..maybe i'm missing some references or what?i've added references to &lt;/p&gt;
&lt;p&gt;C:\Program Files\Microsoft Office\Office12\InfoPathOM\Microsoft.Office.Infopath.dll&lt;/p&gt;
&lt;p&gt;C:\Program Files\Microsoft Office\Office12\Microsoft.Office.InfoPath.FormControl.dll and others but still NewFromFormTemplate method and some others are not available.What should i do in order to be capable to use them?&lt;/p&gt;
&lt;p&gt;Thanks in advance,&lt;/p&gt;
&lt;p&gt;Vitaly&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8876411</link><pubDate>Mon, 18 Aug 2008 16:19:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8876411</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Vitaly,&lt;/p&gt;
&lt;p&gt;As you have seen, everything that is available for designing for the InfoPath client is *not* always available for designing for the browser. This applies not only to object model differences but also controls, etc.&lt;/p&gt;
&lt;p&gt;The method you are asking about is an InfoPath client-only method:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/library/aa942326.aspx"&gt;http://msdn.microsoft.com/en-us/library/aa942326.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8876413</link><pubDate>Mon, 18 Aug 2008 16:20:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8876413</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Vitaly,&lt;/p&gt;
&lt;p&gt;As you have seen, everything that is available for designing for the InfoPath client is *not* always available for designing for the browser. This applies not only to object model differences but also controls, etc.&lt;/p&gt;
&lt;p&gt;The method you are asking about is an InfoPath client-only method:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/library/aa942326.aspx"&gt;http://msdn.microsoft.com/en-us/library/aa942326.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8876487</link><pubDate>Mon, 18 Aug 2008 17:12:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8876487</guid><dc:creator>irgendwo</dc:creator><description>&lt;p&gt;Hi Scott&lt;/p&gt;
&lt;p&gt;Is there any other way to open template from form?For example knowing the URL displayed when you manually create new form from template located in forms library?&lt;/p&gt;
&lt;p&gt;Vitaly&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8876908</link><pubDate>Mon, 18 Aug 2008 20:43:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8876908</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Vitaly,&lt;/p&gt;
&lt;p&gt;If you need to create a new form from the same template, you can set the &amp;quot;Submit&amp;quot; option: Create a new, blank form - this way when your form is submitted, a new blank form will be created. And if you currently do not have a submit connection, you could create one just to &amp;quot;Submit to host&amp;quot; - won't really do anything other than cause a server postback and then create a new form. (It will obviously create a new form so all existing data is gone.)&lt;/p&gt;
&lt;p&gt;However, I don't believe it is possible to create a new form from a different template. In fact - as you have seen, programmatically creating a new template from the same one is not supported - nor is the Rule to create a new form (this too is not available for forms services.)&lt;/p&gt;
&lt;p&gt;So short of the above submit option, I don't believe there is a way to do this. (Other than maybe using your own ASPX page to host the XmlFormView control and using code behind your ASPX page to launch a new form.)&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8878735</link><pubDate>Tue, 19 Aug 2008 16:38:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8878735</guid><dc:creator>irgendwo</dc:creator><description>&lt;p&gt;Hi Scott&lt;/p&gt;
&lt;p&gt;It's a pity there's no simple way to do this..&lt;/p&gt;
&lt;p&gt;What can you say about this:i have a browser-enabled form with managed code which simply adds content of one field to another.But each time i'm clicking the button to perform this action i get this message:&amp;quot;An entry has been added to the Windows event log of the server&amp;quot;. &lt;/p&gt;
&lt;p&gt;Log ID:5337.&lt;/p&gt;
&lt;p&gt;My code is just this: &lt;/p&gt;
&lt;p&gt;XPathNavigator xNavMain2 = this.MainDataSource.CreateNavigator();&lt;/p&gt;
&lt;p&gt;string string1 = xNavMain2.SelectSingleNode(&amp;quot;//my:Comments&amp;quot;, this.NamespaceManager).Value;&lt;/p&gt;
&lt;p&gt; string string2 = xNavMain2.SelectSingleNode(&amp;quot;//my:Add_comment&amp;quot;, this.NamespaceManager).Value;&lt;/p&gt;
&lt;p&gt;xNavMain2.SelectSingleNode(&amp;quot;//my:Add_comment&amp;quot;, this.NamespaceManager).SetValue(&amp;quot;&amp;quot;);&lt;/p&gt;
&lt;p&gt;xNavMain2.SelectSingleNode(&amp;quot;//my:Comments&amp;quot;, this.NamespaceManager).SetValue(string1 + &amp;quot;\n&amp;quot; + System.DateTime.Now + &amp;quot; &amp;quot; + string2);&lt;/p&gt;
&lt;p&gt;What should i do to get rid of this error?&lt;/p&gt;
&lt;p&gt;Vitaly&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8878993</link><pubDate>Tue, 19 Aug 2008 18:24:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8878993</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Vitaly,&lt;/p&gt;
&lt;p&gt;You need to determine what is failing for you. This code works fine in my testing so I would suggest you either see if there is any relevant information in the Application Event log or enable Verbose logging for the various Forms Services categories, reproduce the error and then check the ULS logs on your SharePoint server to see if these point to the cause of the problem.&lt;/p&gt;
&lt;p&gt;Have you tried running this in the InfoPath client? Does it fail there as well?&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8887052</link><pubDate>Fri, 22 Aug 2008 09:56:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8887052</guid><dc:creator>irgendwo</dc:creator><description>&lt;p&gt;Hi Scott&lt;/p&gt;
&lt;p&gt;Got that problem fixed,thanks.It was security issue i think.After setting full trust mode and creating trusted certificate that code worked.&lt;/p&gt;
&lt;p&gt;Scott,what should we do if we want to run some code on client machine?The only available way i see is to save the form in source files and then insert javascript code in,manifest.xsf.Haven't tried it yet,though.Is it really possible?Maybe there are other more friendly ways?&lt;/p&gt;
&lt;p&gt;Vitaly&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#8887920</link><pubDate>Fri, 22 Aug 2008 17:50:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8887920</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Vitaly,&lt;/p&gt;
&lt;p&gt;As you know with a form opened in the browser, all managed code will execute on the server. I have no idea if modifying the manifest as you have described will work; however, it would not be supported.&lt;/p&gt;
&lt;p&gt;As you probably know you can create a custom ASPX page that hosts the XmlFormView control to display your InfoPath forms - there may be some way to get client side script to run from that ASPX page but I am not sure about that.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#9039528</link><pubDate>Tue, 04 Nov 2008 17:32:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9039528</guid><dc:creator>liga</dc:creator><description>&lt;p&gt;hey,&lt;/p&gt;
&lt;p&gt;I'm fairly new to form services.. maybe you can shed some light on this.. I'd really appreciate that. The questions are serious :-)&lt;/p&gt;
&lt;p&gt;1. save to &amp;quot;this&amp;quot; sounds promising. But somehow &amp;quot;SaveLocation&amp;quot; is an unknown key in my dictionary. Now I happen to know there's a SaveLocation Property for XmlFormView. But setting that property doesn't really help. So how am I supposed to open forms carrying along this parameter? Thinking about that.. if I still have to set the parameter manually there's no gain here, is there?&lt;/p&gt;
&lt;p&gt;2. And as you have to publish the form template to the &amp;quot;Form Templates&amp;quot; library I cannot see how saving to &amp;quot;this&amp;quot; library actually makes sense anymore :-/ Don't you typically want to open the form from the forms library and then store filled out forms to another library?&lt;/p&gt;
&lt;p&gt;I'm currently looking for a way to open, save and close within a aspx site automagically. For opening purposes I use the XmlFormView control. The saving part is where I'm stuck right now. Among choosing the right library I also need a way to create unique (filled out) form names. Now() doesn't sound not really promising. Any way I can have GUIDs here?&lt;/p&gt;
&lt;p&gt;Again, help is much appreciated!&lt;/p&gt;
&lt;p&gt;Thanks in advance&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#9044400</link><pubDate>Wed, 05 Nov 2008 17:53:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9044400</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Liga,&lt;/p&gt;
&lt;p&gt;Let me try to address each question:&lt;/p&gt;
&lt;p&gt;#1: See my response to a question on January 2nd - it has modified code.&lt;/p&gt;
&lt;p&gt;#2: First of all, you do not actually &amp;quot;publish&amp;quot; to the Form Templates library. That is a special library that is used when you &amp;quot;Admin&amp;quot; deploy a form template. So the short answer to this is: yes - you want to determine where this form was opened from so you can dynamically determine where to submit the completed form. This is what this sample demonstrates. &lt;/p&gt;
&lt;p&gt;#3: Are you using a custom ASPX page for any special reason? Does the built-in FormsServer.aspx page not provide what you need? At any rate - yes, you can use a GUID to create unique names but you would need to do this in code. There are certainly other options as well:&lt;/p&gt;
&lt;p&gt;- Use a combination of fields from your form template&lt;/p&gt;
&lt;p&gt;- Use code (or a web service) to pull a unique number from a database (i.e. SQL Server)&lt;/p&gt;
&lt;p&gt;- Use a web service to generate and return a random number or GUID - this would eliminate the need to do this in code behind your form template&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#9044872</link><pubDate>Wed, 05 Nov 2008 21:14:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9044872</guid><dc:creator>liga</dc:creator><description>&lt;p&gt;Thanks for your reply, Scott :-)&lt;/p&gt;
&lt;p&gt;@3: Yes. Special reasons being: The form has to be shown in the context of a website. We do not want to open a new window. I already tried assigning a GUID but as it turns out Filename is a read-only property (on FileSubmitConnection). But as I'm still struggling with all the &amp;quot;dynamically save to library x&amp;quot; part I didn't really look into that yet. Any directions you can point me to?&lt;/p&gt;
&lt;p&gt;@2: Yes, I understand that. But still you open the form directly from that &amp;quot;special&amp;quot; library don't you? (no matter if you use formsserver.aspx or some custom.aspx site with a xmlformview control)&lt;/p&gt;
&lt;p&gt;So let's assume I have 10 different forms in my forms template library. Doesn't each and every one have the same &amp;quot;Request url&amp;quot;?&lt;/p&gt;
&lt;p&gt;It would make sense if you had a webpage in a library (let's say &amp;quot;NovemberForms&amp;quot; and within that page open a form from the forms template library and save that to novemberforms library. Much like reading the Request object in asp.&lt;/p&gt;
&lt;p&gt;On a side note.. are there forums I can turn to?&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#9049308</link><pubDate>Thu, 06 Nov 2008 17:59:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9049308</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Liga,&lt;/p&gt;
&lt;p&gt;The point of the code in this sample is this: let's say you publish a browser-compatible XSN and want to use this in multiple document libraries. With the out of the box functionality, when you setup a &amp;quot;submit&amp;quot; connection to allow the user to &amp;quot;submit&amp;quot; the completed form, it can only submit to the library which you setup at design time. With this sample, it dynamically determines the library from which the form was launched so it submits the completed form to that library.&lt;/p&gt;
&lt;p&gt;Now, maybe where the confusion is coming in is this: you are correct that when you &amp;quot;Admin&amp;quot; deploy an XSN, the resulting (uploaded and activated) XSN resides in a special &amp;quot;Form Server Templates&amp;quot; library; however, this is *not* where you want to use this form. What you should be doing is creating other libraries where you want to use that XSN, setting the &amp;quot;Allow management of content types&amp;quot; to Yes for those libraries and then adding that XSN from the Content Types list to that library. &lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#9052348</link><pubDate>Fri, 07 Nov 2008 18:14:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9052348</guid><dc:creator>liga</dc:creator><description>&lt;p&gt;Great! It all makes sense now :-)&lt;/p&gt;
&lt;p&gt;Oh and there's a SaveLocation parameter in the url now, so that's working, too. *happy*&lt;/p&gt;
&lt;p&gt;Unfortunately another part of my solution broke apart while switching to the new multi-purpose library.&lt;/p&gt;
&lt;p&gt;I can't open the new form within an XmlViewControl (within my webpart) anymore.&lt;/p&gt;
&lt;p&gt;I set XsnLocation to the url I get when creating a new form from my library.&lt;/p&gt;
&lt;p&gt;&amp;quot;The following file is not a valid InfoPath form template&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://forms.domain.tld/_layouts/FormServer.aspx?XsnLocation=http://forms.domain.tld/FormServerTemplates/SampleSimpleFormWithCode.xsn&amp;amp;SaveLocation=http://forms.domain.tld/test"&gt;http://forms.domain.tld/_layouts/FormServer.aspx?XsnLocation=http://forms.domain.tld/FormServerTemplates/SampleSimpleFormWithCode.xsn&amp;amp;SaveLocation=http://forms.domain.tld/test&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Opening the form directly (without xmlformview control) works perfectly fine.&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#9053447</link><pubDate>Sat, 08 Nov 2008 04:20:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9053447</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi Liga,&lt;/p&gt;
&lt;p&gt;Glad you are making progress! In regard to the XmlViewControl, have you tried setting the XsnLocation to this:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://forms.domain.tld/FormServerTemplates/SampleSimpleFormWithCode.xsn"&gt;http://forms.domain.tld/FormServerTemplates/SampleSimpleFormWithCode.xsn&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#9057424</link><pubDate>Mon, 10 Nov 2008 17:13:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9057424</guid><dc:creator>liga</dc:creator><description>&lt;p&gt;Hi Scott,&lt;/p&gt;
&lt;p&gt;I tried that. As soon as you add any additional parameters to the XsnLocation property the XmlFormView fails to load the form.&lt;/p&gt;
&lt;p&gt;If I omit the SaveLocation parameter.. guess what.. KeyNotFoundException :-)&lt;/p&gt;
&lt;p&gt;So I guess I'll have to specify the target library prior to deployment rather than figuring it out dynamically :-(&lt;/p&gt;
</description></item><item><title>re: Submitting to 'this' document library</title><link>http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx#9057429</link><pubDate>Mon, 10 Nov 2008 17:17:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9057429</guid><dc:creator>infopath</dc:creator><description>&lt;p&gt;Hi liga,&lt;/p&gt;
&lt;p&gt;I have never used the XmlView control (I am assuming this is a SharePoint web part?) so this may not work as you need.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;
</description></item></channel></rss>