<?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>SharePoint Integration</title><link>https://www.infopathdev.com:443/forums/46.aspx</link><description> For questions concerning issues in the integration of SharePoint and Microsoft InfoPath.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Using VB to update a SharePoint 2007 list item in InfoPath 2003</title><link>https://www.infopathdev.com:443/forums/thread/72872.aspx</link><pubDate>Tue, 13 Dec 2011 17:16:35 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:72872</guid><dc:creator>Daggy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/72872.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=72872</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Still struggling with this... some more information &lt;/p&gt;&lt;p&gt;http://blog-sharepoint.blogspot.com/2009/07/summary-how-to-programmatically-update.html&lt;/p&gt;&lt;p&gt;http://blog-sharepoint.blogspot.com/2009/07/infopath-update-repeating-elementsnodes.html &lt;/p&gt;&lt;p&gt;I&amp;#39;ve followed through the guides and comments within the guides listed above. The most helpful part was the comments. I was able to follow them through to the end, however the desired functionality isn&amp;#39;t achieved...&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Here&amp;#39;s the code that I use:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;#39;Load the XML Document of the repeating data source&lt;br /&gt;Dim xmlDataSource&lt;br /&gt;Dim UpdateXML&lt;br /&gt;Set xmlDataSource = XDocument.GetDOM(&amp;quot;camlstats&amp;quot;)&lt;br /&gt;Set UpdateXML = xmlDataSource.selectNodes(&amp;quot;/Batch/Method/Field&amp;quot;)&lt;br /&gt;&lt;br /&gt;&amp;#39;This loops through the repepeating element in the data source and&lt;br /&gt;&amp;#39;sets the value of the repeating field if the name attribute matches &lt;br /&gt;&amp;#39;the first param: XMLFieldName. &amp;nbsp;&lt;br /&gt;&amp;#39;the sourceField param accepts a string containing the XPath to the&lt;br /&gt;&amp;#39;field which has the value which is to be set as&lt;br /&gt;&amp;#39;the value of the required repeating element.&lt;br /&gt;Sub updateXMLDataSource(XMLFieldName, sourceField)&lt;br /&gt;&amp;nbsp; Dim count&lt;br /&gt;&amp;nbsp; Dim DSNode&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;#39;Loop through each element in the data source to find the&lt;br /&gt;&amp;nbsp; &amp;#39;required field in the CAML template&lt;br /&gt;&lt;br /&gt;&amp;nbsp; For count = 0 To UpdateXML.length -1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39;Test if the name attribute of the current&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39;element matches the required field&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If UpdateXML(count).getAttribute(&amp;quot;Name&amp;quot;) = XMLFieldName Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39;Element Found: Update the value of current&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39;element to the value of souceField parameter (XPATH)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set DSNode = XDocument.DOM.selectSingleNode(sourceField)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UpdateXML(count).text = DSNode.text&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;&amp;nbsp; Next&lt;br /&gt;&amp;nbsp;&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Sub XDocument_OnLoad(eventObj)&lt;br /&gt;&amp;#39; Write your code here&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&amp;#39;=======&lt;br /&gt;&amp;#39; The following function handler is created by Microsoft Office InfoPath.&lt;br /&gt;&amp;#39; Do not modify the name of the function, or the name and number of arguments.&lt;br /&gt;&amp;#39;=======&lt;br /&gt;Sub CTRL16_5_OnClick(eventObj)&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;dim MyField&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;For count = 0 To UpdateXML.length -1&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;MyField = UpdateXML(count).getAttribute(&amp;quot;Name&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Msgbox MyField&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;MsgBox UpdateXML(count).text&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Next&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Dim Items&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Set SharePointDataSource = XDocument.GetDOM(&amp;quot;Network Access Form Statistics-viewonly&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SharePointDataSource.setProperty &amp;quot;SelectionNamespaces&amp;quot;, &amp;quot;xmlns:dfs=&amp;quot;&amp;quot;http://schemas.microsoft.com/office/infopath/2003/dataFormSolution&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Set Items = SharePointDataSource.selectNodes(&amp;quot;/dfs:myFields/dfs:dataFields/dfs:Network_Access_Form_Statistics&amp;quot;)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;MsgBox Items.Length &amp;#39;returns correct number -- 2&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;For count = 0 to Items.Length - 1&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;MsgBox Items(count).selectSingleNode(&amp;quot;//@Title&amp;quot;).Text &amp;#39;returns the first title twice, but not second&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Next&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Call updateXMLDataSource(&amp;quot;Year&amp;quot;, &amp;quot;/my:myFields/my:updatetext&amp;quot;)&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&amp;#39;=======&lt;br /&gt;&amp;#39; The following function handler is created by Microsoft Office InfoPath.&lt;br /&gt;&amp;#39; Do not modify the name of the function, or the name and number of arguments.&lt;br /&gt;&amp;#39;=======&lt;br /&gt;Sub CTRL18_5_OnClick(eventObj)&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;XDocument.DataAdapters(&amp;quot;Store Lists on SP&amp;quot;).Submit&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;=======================================================================&lt;/p&gt;&lt;p&gt;This loop:&lt;/p&gt;&lt;p&gt;&amp;nbsp;For count = 0 To UpdateXML.length -1&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;MyField = UpdateXML(count).getAttribute(&amp;quot;Name&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Msgbox MyField&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;MsgBox UpdateXML(count).text&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Next&lt;/p&gt;&lt;p&gt;The first MsgBox successfully displays the column names noted in the caml.xml above.&amp;nbsp; &lt;/p&gt;&lt;p&gt;The second MsgBox displays nothing.&lt;/p&gt;&lt;p&gt;&amp;nbsp;=======================================================================&lt;/p&gt;&lt;p&gt;This loop: &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For count = 0 to Items.Length - 1&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;MsgBox Items(count).selectSingleNode(&amp;quot;//@Title&amp;quot;).Text &amp;#39;returns the first title twice, but not second&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Next&lt;/p&gt;&lt;p&gt;&amp;nbsp; &lt;br /&gt;Displays the first row&amp;#39;s &amp;quot;Title&amp;quot; data for however many total rows there are, however it does not successfully display each row&amp;#39;s title data, only the first.&lt;/p&gt;&lt;p&gt;&amp;nbsp;=======================================================================&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I&amp;#39;m going to continue using Google to search how to update a SP 2007 list via IP 2003 using VB. If anyone has successfully been able to do this I would greatly appreciate some guidance!&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Using VB to update a SharePoint 2007 list item in InfoPath 2003</title><link>https://www.infopathdev.com:443/forums/thread/72753.aspx</link><pubDate>Thu, 08 Dec 2011 15:04:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:72753</guid><dc:creator>Daggy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/72753.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=72753</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hello,&lt;/p&gt;&lt;p&gt;&amp;nbsp;For the past few days I have been trying to set up an IP 2003 form to update a specific item in a SP 2007 list.&lt;/p&gt;&lt;p&gt;The list has the following: Title, Year, Month, TicketCount, TicketsCompleted&lt;/p&gt;&lt;p&gt;&amp;nbsp;The following is in my caml.xml file:&lt;/p&gt;&lt;p&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;Batch OnError=&amp;quot;Continue&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Method ID=&amp;quot;1&amp;quot; Cmd=&amp;quot;Update&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Field Name=&amp;#39;Title&amp;#39;&amp;gt;&amp;lt;/Field&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Field Name=&amp;quot;Year&amp;quot;&amp;gt;&amp;lt;/Field&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Field Name=&amp;quot;Month&amp;quot;&amp;gt;&amp;lt;/Field&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Field Name=&amp;quot;TicketCount&amp;quot;&amp;gt;&amp;lt;/Field&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Field Name=&amp;quot;TicketsCompleted&amp;quot;&amp;gt;&amp;lt;/Field&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Method&amp;gt;&lt;br /&gt;&amp;lt;/Batch&amp;gt; &lt;/p&gt;&lt;p&gt;With VB I managed to find and use some code to retrieve a row&amp;#39;s information, however I was not able to get it to iterate through all rows. (i.e. I was only able to retrieve the first row&amp;#39;s data... when trying to access any other rows it would just return the first row&amp;#39;s information).&lt;br /&gt;&lt;/p&gt;&lt;p&gt;More importantly I have not yet been able to figure out how to update the secondary data source&amp;#39;s XML file and then send it back to the SP 2007 list to update the row. I was able to create an entirely new row, however updating an existing row has seemed impossible.&lt;/p&gt;&lt;p&gt;&amp;nbsp;What I need help with, I think, is reading/updating the secondary data source&amp;#39;s .xml file and then submitting it to the SP 2007 list to update it.&lt;/p&gt;&lt;p&gt;&amp;nbsp;I have been using google relentlessly for answers... almost all related links pop up purple/read and I still haven&amp;#39;t managed to create a solution.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Any help/guidance would be greatly appreciated. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>