<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Object Reference Error</title><link>https://www.infopathdev.com:443/forums/thread/2837.aspx</link><pubDate>Fri, 21 Jul 2006 21:44:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:2837</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/2837.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=2837</wfw:commentRss><description>For some reason the selectSingleNode() statement is not returning a reference to that node. You will have to alter the XPath to correctly select the node.  It does sound like there might be a namespace issue here, but if this is just a 2DS that you imported into the form then there shouldn't be a namespace problem.  Maybe the 'item' row hasn't been inserted at the time that this code is called?&lt;br /&gt;&lt;br /&gt;You could add a IF block that tests to see if the node is null, and if so, quits.</description></item><item><title>Re: Object Reference Error</title><link>https://www.infopathdev.com:443/forums/thread/2836.aspx</link><pubDate>Fri, 21 Jul 2006 20:51:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:2836</guid><dc:creator>JSGSR</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/2836.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=2836</wfw:commentRss><description>I don't think the issue is with how I set up the data sources it appears to be with how i am trying to set the value in the CAML template.  What I am trying to do was modeled after this "How-To":&lt;br /&gt;&lt;br /&lt;a target="_blank" href=http://www.infopathdev.com/howto/tutorials/default.aspx?i=1d52979046884d8186c9393a1ea95109&gt;http://www.infopathdev.com/howto/tutorials/default.aspx?i=1d52979046884d8186c9393a1ea95109&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I want to programmatically assign the value in the CAML like this and that is where the error occurs:&lt;br /&gt;&lt;br /&gt;thisXDocument.GetDOM("Add List Item Template").selectSingleNode("/AddListItems/Batch/Method/Field[@Name = 'item']").text = Action&lt;br /&gt;&lt;br /&gt;Do I have to do something with a namespace to be able to access this CAML I have created?&lt;br /&gt;&lt;br /&gt;Thanks for your time so far.  I appreciate your help.&lt;br /&gt;</description></item><item><title>Re: Object Reference Error</title><link>https://www.infopathdev.com:443/forums/thread/2835.aspx</link><pubDate>Fri, 21 Jul 2006 20:02:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:2835</guid><dc:creator>Clay Fox</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/2835.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=2835</wfw:commentRss><description>Here are some links that are similar.&lt;br /&gt;&lt;br /&lt;a target="_blank" href=http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=2886&gt;http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=2886&lt;/a&gt;&lt;br /&gt;&lt;br /&lt;a target="_blank" href=http://www.infopathdev.com/howto/tutorials/default.aspx?i=7bc880f391b84ea9b3b45c6fbecc07c6&gt;http://www.infopathdev.com/howto/tutorials/default.aspx?i=7bc880f391b84ea9b3b45c6fbecc07c6&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I am not sure it is possible to have the GUID in the CAML template.  I thought it needed to be another  field since the GUID is identifying the list and not part of the list data.&lt;br /&gt;I could be wrong but I know the steps in the links work.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</description></item><item><title>Object Reference Error</title><link>https://www.infopathdev.com:443/forums/thread/1435.aspx</link><pubDate>Fri, 21 Jul 2006 19:29:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:1435</guid><dc:creator>JSGSR</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/1435.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=1435</wfw:commentRss><description>I am trying to programmatically insert a new entry in a sharepoint list when a user clicks a cmd button.&lt;br /&gt;&lt;br /&gt;I am modeling my solution after the how-to regarding deleting a form in a library.&lt;br /&gt;&lt;br /&gt;My XML SEcondary Data Source Looks Like this and is named Add List Item Template:&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;AddListItems&amp;gt;&lt;br /&gt;  &amp;lt;ListName&amp;gt;{0A3CB4D1-CB8D-4AE4-A336-D106517F8D9A}&amp;lt;/ListName&amp;gt;&lt;br /&gt;    &amp;lt;Batch OnError="Continue"&amp;gt;&lt;br /&gt;      &amp;lt;Method ID="1" Cmd="New"&amp;gt;&lt;br /&gt;        &amp;lt;Field Name="Item"&amp;gt;&amp;lt;/Field&amp;gt;&lt;br /&gt;        &amp;lt;Field Name="Champion"&amp;gt;&amp;lt;/Field&amp;gt;&lt;br /&gt;        &amp;lt;Field Name="Assigned"&amp;gt;&amp;lt;/Field&amp;gt;&lt;br /&gt;        &amp;lt;Field Name="Due"&amp;gt;&amp;lt;/Field&amp;gt;&lt;br /&gt;        &amp;lt;Field Name="Completed"&amp;gt;&amp;lt;/Field&amp;gt;&lt;br /&gt;      &amp;lt;/Method&amp;gt;&lt;br /&gt;    &amp;lt;/Batch&amp;gt; &lt;br /&gt;&amp;lt;/AddListItems&amp;gt;&lt;br /&gt;&lt;br /&gt;My Code Looks like this:&lt;br /&gt;Public Function createFollowUp(ByVal Action As String)&lt;br /&gt;&lt;br /&gt;thisXDocument.GetDOM("Add List Item Template").selectSingleNode("/AddListItems/Batch/Method/Field[@Name = 'item']").text = Action&lt;br /&gt;&lt;br /&gt;Dim webservice As WebServiceAdapter2&lt;br /&gt;webservice = thisXDocument.DataAdapters.Item(4)&lt;br /&gt;webservice.Submit()&lt;br /&gt;&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;I get the error:&lt;br /&gt;System.NullReferenceException&lt;br /&gt;Object reference not set to an instance of an object.&lt;br /&gt;   at SafetyAudits.SafetyAudits.createFollowUp(String Action)&lt;br /&gt;   at SafetyAudits.SafetyAudits.CTRL647_4_OnClick(DocActionEvent e)&lt;br /&gt;   at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)&lt;br /&gt;&lt;br /&gt;Most of what I have read regarding this error says that I am not referencing the xml properly but I am unable to figure it out...</description></item></channel></rss>