<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Batch Undefined Error</title><link>https://www.infopathdev.com:443/forums/thread/73358.aspx</link><pubDate>Fri, 30 Dec 2011 18:04:35 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:73358</guid><dc:creator>ChrisMurphy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/73358.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=73358</wfw:commentRss><description>var batch = XDocument.DataObjects[&amp;quot;NewItemXML&amp;quot;].DOM;</description></item><item><title>Re: Batch Undefined Error</title><link>https://www.infopathdev.com:443/forums/thread/65221.aspx</link><pubDate>Wed, 16 Mar 2011 01:01:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65221</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65221.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=65221</wfw:commentRss><description>&lt;p&gt;But that is C#, for IP 2007, and assumes that his data source is called &amp;quot;CustomListCAML&amp;quot;. The original poster&amp;#39;s code sample is jscript, thus using the 2003 OM.&lt;/p&gt;</description></item><item><title>Re: Batch Undefined Error</title><link>https://www.infopathdev.com:443/forums/thread/65217.aspx</link><pubDate>Tue, 15 Mar 2011 22:26:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65217</guid><dc:creator>Josee Sevigny</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65217.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=65217</wfw:commentRss><description>&lt;p&gt;Try this: &lt;/p&gt;&lt;font size="1"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="1"&gt;&lt;font color="#008000" size="1"&gt;//get the CAML&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="1"&gt;&lt;font color="#2b91af" size="1"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="1"&gt; batch = DataSources[&lt;/font&gt;&lt;font color="#a31515" size="1"&gt;&lt;font color="#a31515" size="1"&gt;&amp;quot;CustomListCAML&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="1"&gt;].CreateNavigator();&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Batch Undefined Error</title><link>https://www.infopathdev.com:443/forums/thread/65211.aspx</link><pubDate>Tue, 15 Mar 2011 19:05:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65211</guid><dc:creator>jay.will</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65211.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=65211</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;thank you i will try and respond if it works or not&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Batch Undefined Error</title><link>https://www.infopathdev.com:443/forums/thread/65210.aspx</link><pubDate>Tue, 15 Mar 2011 18:40:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65210</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65210.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=65210</wfw:commentRss><description>&lt;p&gt;You are using a variable called &amp;quot;batch&amp;quot; - you need to define it in the script just like you define &amp;quot;ID&amp;quot;. &lt;/p&gt;
&lt;p&gt;So, something like var batch = XDocument.GetDOM(&amp;quot;&lt;strong&gt;Batch&lt;/strong&gt;&amp;quot;)&lt;/p&gt;
&lt;p&gt;With &lt;strong&gt;Batch&lt;/strong&gt; replaced with the actual data source name of your data connection to your resource file. &lt;/p&gt;</description></item><item><title>Re: Batch Undefined Error</title><link>https://www.infopathdev.com:443/forums/thread/65203.aspx</link><pubDate>Tue, 15 Mar 2011 18:04:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65203</guid><dc:creator>jay.will</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65203.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=65203</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;In the Infopath form I have the batch as a resource file as well as a data connection to the batch as well as in the web service submit. where would i define the batch in the script. any suggestions&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Batch Undefined Error</title><link>https://www.infopathdev.com:443/forums/thread/65198.aspx</link><pubDate>Tue, 15 Mar 2011 17:25:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65198</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65198.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=65198</wfw:commentRss><description>&lt;p&gt;See how you are defining all your other variables -- var ID, etc? You aren&amp;#39;t defining &amp;quot;batch&amp;quot; anywhere.&lt;/p&gt;</description></item><item><title>Re: Batch Undefined Error</title><link>https://www.infopathdev.com:443/forums/thread/65182.aspx</link><pubDate>Tue, 15 Mar 2011 14:13:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65182</guid><dc:creator>jay.will</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65182.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=65182</wfw:commentRss><description>&lt;p&gt;Hello the entire code is below &lt;br /&gt;&lt;/p&gt;&lt;p&gt;function ListSubmit(xCAML,submitx)
&lt;/p&gt;&lt;p&gt;{
var root = XDocument.DOM;&lt;/p&gt;&lt;p&gt;

var ID = root.selectSingleNode(&amp;quot;my:myFields/my:ID&amp;quot;).text;&lt;/p&gt;&lt;p&gt;
var Name = root.selectSingleNode(&amp;quot;my:myFields/my:Name&amp;quot;).text;&lt;/p&gt;&lt;p&gt;
var From = root.selectSingleNode(&amp;quot;my:myFields/my:From&amp;quot;).text;
&lt;/p&gt;&lt;p&gt;var To = root.selectSingleNode(&amp;quot;my:myFields/my:To&amp;quot;).text;&lt;/p&gt;&lt;p&gt;
var Computers = root.selectSingleNode(&amp;quot;my:myFields/my:Computers&amp;quot;).text;
&lt;/p&gt;&lt;p&gt;var Projectors = root.selectSingleNode(&amp;quot;my:myFields/my:Projectors&amp;quot;).text;
&lt;/p&gt;&lt;p&gt;var Cameras = root.selectSingleNode(&amp;quot;my:myFields/my:Cameras&amp;quot;).text;
&lt;/p&gt;&lt;p&gt;var Comments = root.selectSingleNode(&amp;quot;my:myFields/my:Comments&amp;quot;).text;
&lt;/p&gt;&lt;p&gt;var Location = root.selectSingleNode(&amp;quot;my:myFields/my:Location&amp;quot;).text;
&lt;/p&gt;&lt;p&gt;var LaptopCharger = root.selectSingleNode(&amp;quot;my:myFields/my:LaptopCharger&amp;quot;).text;
&lt;/p&gt;&lt;p&gt;var Clicker = root.selectSingleNode(&amp;quot;my:myFields/my:Clicker&amp;quot;).text;&lt;/p&gt;&lt;p&gt;// Set the SharePoint ID
&lt;/p&gt;&lt;p&gt;&lt;b&gt;batch.selectSingleNode(&amp;quot;/Batch/Method/Field[@Name=&amp;#39;ID&amp;#39;]&amp;quot;).text = ID; &amp;lt; line that is throwing the batch undefined error&amp;gt;&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;

// Set the Rerservers Name
&lt;/p&gt;&lt;p&gt;batch.selectSingleNode(&amp;quot;/Batch/Method/Field[@Name=&amp;#39;Title&amp;#39;]&amp;quot;).text = Name;&lt;/p&gt;&lt;p&gt;

// Set the From Date
&lt;/p&gt;&lt;p&gt;batch.selectSingleNode(&amp;quot;/Batch/Method/Field[@Name=&amp;#39;Check_x0020_Out_x0020_From&amp;#39;]&amp;quot;).text = From;&lt;/p&gt;&lt;p&gt;

// Set the To Date
&lt;/p&gt;&lt;p&gt;batch.selectSingleNode(&amp;quot;/Batch/Method/Field[@Name=&amp;#39;Check_x0020_Out_x0020_Date&amp;#39;]&amp;quot;).text = To;
&lt;/p&gt;&lt;p&gt;
// Set the Computers
&lt;/p&gt;&lt;p&gt;batch.selectSingleNode(&amp;quot;/Batch/Method/Field[@Name=&amp;#39;Computer&amp;#39;]&amp;quot;).text = Computers;

&lt;/p&gt;&lt;p&gt;// Set the Projectos&lt;/p&gt;&lt;p&gt;
batch.selectSingleNode(&amp;quot;/Batch/Method/Field[@Name=&amp;#39;Projector&amp;#39;]&amp;quot;).text = Projectors;

&lt;/p&gt;&lt;p&gt;// Set the Cameras&lt;/p&gt;&lt;p&gt;
batch.selectSingleNode(&amp;quot;/Batch/Method/Field[@Name=&amp;#39;Digital_x0020_Camera&amp;#39;]&amp;quot;).text = Cameras;&lt;/p&gt;&lt;p&gt;

// Set the Comments
batch.selectSingleNode(&amp;quot;/Batch/Method/Field[@Name=&amp;#39;Comments&amp;#39;]&amp;quot;).text = Comments;

&lt;/p&gt;&lt;p&gt;// Set the Location
&lt;/p&gt;&lt;p&gt;batch.selectSingleNode(&amp;quot;/Batch/Method/Field[@Name=&amp;#39;Location&amp;#39;]&amp;quot;).text = Location;
&lt;/p&gt;&lt;p&gt;
// Set the Laptop Charger
&lt;/p&gt;&lt;p&gt;batch.selectSingleNode(&amp;quot;/Batch/Method/Field[@Name=&amp;#39;Laptop_x0010_Chargers&amp;#39;]&amp;quot;).text = LaptopCharger;&lt;/p&gt;&lt;p&gt;

// Set the Clicker&lt;/p&gt;&lt;p&gt;
batch.selectSingleNode(&amp;quot;/Batch/Method/Field[@Name=&amp;#39;Clickers&amp;#39;]&amp;quot;).text = Clicker;

&lt;/p&gt;&lt;p&gt;// Submit the item details to the web service to update the list&lt;/p&gt;&lt;p&gt;
XDocument.DataAdapters[submitx].Submit();
} &lt;/p&gt;&lt;p&gt;//=======
// The following function handler is created by Microsoft Office InfoPath.
// Do not modify the name of the function, or the name and number of arguments.
//=======

&lt;/p&gt;&lt;p&gt;function CTRL16::OnClick(eventObj)&lt;/p&gt;&lt;p&gt;
{
var error = XDocument.Errors.Count;&lt;/p&gt;&lt;p&gt;

if(error !=0)&lt;/p&gt;&lt;p&gt;	
{
&lt;/p&gt;&lt;p&gt;	objError = XDocument.Errors(0); //pinpoin data validation error and return alert
	&lt;/p&gt;&lt;p&gt;XDocument.UI.Alert(&amp;quot;Error message: &amp;quot; + objError.ShortErrorMessage);&lt;/p&gt;&lt;p&gt;
}
&lt;/p&gt;&lt;p&gt;else&lt;/p&gt;&lt;p&gt;
{&lt;/p&gt;&lt;p&gt;
//if (XDocument.Dom.selectSingleNode(&amp;quot;my:myFields/my:ID&amp;quot;).text==[&amp;quot;&amp;quot;]) //Prevent a 2nd attempt Submit if an ID has been assigned&lt;/p&gt;&lt;p&gt;
//{
&lt;/p&gt;&lt;p&gt;//if (!(XDocument.Dom.selectSingleNode(&amp;quot;my:myFields/my:Project_Name&amp;quot;).text==[&amp;quot;&amp;quot;])) //Prevent initial Submit if no Project Name has been assigned
&lt;/p&gt;&lt;p&gt;//{
&lt;/p&gt;&lt;p&gt;
//var submit1confirm=0&lt;/p&gt;&lt;p&gt;
ListSubmit(&amp;quot;SubmitBatch&amp;quot;,&amp;quot;Web Service Submit&amp;quot;);
&lt;/p&gt;&lt;p&gt;XDocument.DOM.selectSingleNode(&amp;quot;my:myFields/my:submitrules&amp;quot;).text = 1;&lt;/p&gt;&lt;p&gt;
}&lt;/p&gt;&lt;p&gt;
} &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Batch Undefined Error</title><link>https://www.infopathdev.com:443/forums/thread/65141.aspx</link><pubDate>Mon, 14 Mar 2011 18:14:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65141</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65141.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=65141</wfw:commentRss><description>&lt;p&gt;Hi -- &lt;/p&gt;
&lt;p&gt;It would help to see the code prior to this line as well, since the undefined error makes me think that you&amp;#39;ve not initialized the variable named &amp;quot;batch&amp;quot;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Batch Undefined Error</title><link>https://www.infopathdev.com:443/forums/thread/65139.aspx</link><pubDate>Mon, 14 Mar 2011 17:24:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65139</guid><dc:creator>jay.will</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65139.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=65139</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi I am doing a SharePoint/InfoPath site and when I click my submit button I get an error that says Batch is Undefined. Below is a copy the code that is throwing the error&lt;/p&gt;&lt;p&gt;&amp;nbsp;batch.selectSingleNode(&amp;quot;/Batch/Method/Field[@Name=&amp;#39;ID&amp;#39;]&amp;quot;).text = ID;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Any help would be appreciated&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;-The batch is stored as a resource file and a data connection &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>