<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Problems with CAML/BATCH/Submitting</title><link>https://www.infopathdev.com:443/forums/thread/29754.aspx</link><pubDate>Wed, 25 Jun 2008 15:25:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:29754</guid><dc:creator>aevay</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/29754.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=29754</wfw:commentRss><description>&lt;p&gt;
Based originally on this tutorial from MSDN;
http://msdn.microsoft.com/en-us/library/cc162745.aspx#ip2007SubmitDataSPList_AddingaConnectiontotheListsWebServiceandSpecifyingtheParametersoftheUpdateListItemsWebMethod
&lt;/p&gt;

&lt;p&gt;
... the form does submit, and a new item is created, all the fields are just empty.
&lt;/p&gt;

&lt;p&gt;
I created the Document Library through the Publishing option through InfoPath.
&lt;/p&gt;

&lt;p&gt;
In my form, one field is named &amp;#39;OptionA&amp;#39;; In my form I have eight fields, and for the sake of simplicity I&amp;#39;ll only focus on that one. Within the Batch CAML fragment &amp;#39;Template.xml&amp;#39; I&amp;#39;ve defined the following;
&lt;/p&gt;

&lt;pre&gt;&amp;lt;batch onerror=&amp;quot;Return&amp;quot;&amp;gt;&lt;br /&gt;	&amp;lt;method id=&amp;quot;1&amp;quot; cmd=&amp;quot;New&amp;quot;&amp;gt;&lt;br /&gt;		&amp;lt;-- .... --&amp;gt;&lt;br /&gt;		&amp;lt;field name=&amp;quot;OptionA&amp;quot;&amp;gt;&amp;lt;/field&amp;gt;&lt;br /&gt;		&amp;lt;-- .... --&amp;gt;&lt;br /&gt;	&amp;lt;/method&amp;gt;&lt;br /&gt;&amp;lt;/batch&amp;gt;&lt;br /&gt;&lt;/pre&gt;

&lt;p&gt;
Then in my source I&amp;#39;ve limited the MSDN source to what I needed for submitting only since I have no need to read information from the list yet.
&lt;/p&gt;

&lt;p&gt;
I&amp;#39;ve set a submit button up to execute custom code, where in the _Submit method I&amp;#39;ve defined the following;
&lt;/p&gt;

&lt;pre&gt;XmlNamespaceManager ns = this.NamespaceManager;&lt;br /&gt;DataSource dsCAML = this.DataSources[&amp;quot;Template&amp;quot;];&lt;br /&gt;XPathNavigator xnCAML = dsCAML.CreateNavigator();&lt;br /&gt;WebServiceConnection wsSubmit = (WebServiceConnection)this.DataConnections[&amp;quot;Web_Service_Submit&amp;quot;];&lt;br /&gt;XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();&lt;br /&gt;XPathNodeIterator xiNewFields = xnDoc.Select(&amp;quot;/my:myFields&amp;quot;, ns);&lt;br /&gt;&lt;br /&gt;if (xiNewFields.Count &amp;gt; 0)&lt;br /&gt;{&lt;br /&gt;	while (xiNewFields.MoveNext())&lt;br /&gt;	{&lt;br /&gt;		xnCAML.SelectSingleNode(&lt;br /&gt;		&amp;quot;/Batch/Method/Field[@Name=&amp;#39;OptionA&amp;#39;]&amp;quot;, ns)&lt;br /&gt;		.SetValue(xiNewFields.Current.SelectSingleNode(&lt;br /&gt;		&amp;quot;my:OptionA&amp;quot;, ns).Value);&lt;br /&gt;&lt;br /&gt;	// ...&lt;br /&gt;	}&lt;br /&gt;	&lt;br /&gt;	xnCAML.SelectSingleNode(&amp;quot;/Batch/Method/@Cmd&amp;quot;, ns).SetValue(&amp;quot;New&amp;quot;);&lt;br /&gt;	wsSubmit.Execute();&lt;br /&gt;}&lt;br /&gt;// ...&lt;br /&gt;&lt;/pre&gt;

&lt;p&gt;
Does anyone see a disconnect in this mapping which would prevent my form information from being properly submitted to the Document Library?
&lt;/p&gt;

&lt;p&gt;
Like I said, the form does submit, and a new item is created, all the fields are just empty.
&lt;/p&gt;

&lt;p&gt;
Edit / Update:
This is what OptionA as a field looks like in my Document Library;
&lt;/p&gt;

&lt;pre&gt;&amp;lt;Field DisplayName=&amp;quot;OptionA&amp;quot; ReadOnly=&amp;quot;TRUE&amp;quot; Node=&amp;quot;/my:myFields/my:OptionA&amp;quot; Type=&amp;quot;Text&amp;quot;
Group=&amp;quot;Microsoft Office InfoPath&amp;quot; XName=&amp;quot;{7D93291E-27AA-4EB6-9C36-53C9D4804B74}&amp;quot;
ID=&amp;quot;{d7ad1862-18bf-4a12-aa77-bcbd9df8c473}&amp;quot; SourceID=&amp;quot;{3b2ae548-9f42-43f8-961f-9267d6421f24}&amp;quot;
StaticName=&amp;quot;OptionA&amp;quot; Name=&amp;quot;OptionA&amp;quot; ColName=&amp;quot;nvarchar13&amp;quot; RowOrdinal=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;&lt;/pre&gt;</description></item></channel></rss>