<?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: InfoPath form error when connecting to data source</title><link>https://www.infopathdev.com:443/forums/thread/29648.aspx</link><pubDate>Mon, 23 Jun 2008 20:37:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:29648</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/29648.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=29648</wfw:commentRss><description>&lt;p&gt;Hi, Charlie:&lt;/p&gt;
&lt;p&gt;I would expect this line:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;var selectedNode = doc.selectSingleNode(&amp;quot;/dfs:myFields/dfs:dataFields/dfs:Project_Metrics_Library/@Project_Name=[&amp;#39;selectedField&amp;#39;]&amp;quot;); &lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;to look more like this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;var selectedNode = doc.selectSingleNode(&amp;quot;/dfs:myFields/dfs:dataFields/dfs:Project_Metrics_Library[@Project_Name=&amp;#39;&amp;quot; + selectedField + &amp;quot;&amp;#39;]&amp;quot;); &lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;This will select the Project_Metrics_Library node that has a Project_Name attribute that matches the value in your selectedField variable.As long as each Project_Metrics_Library has a unique Project_Name attribute you will get just the node that matches the selectedField.&lt;/p&gt;</description></item><item><title>InfoPath form error when connecting to data source</title><link>https://www.infopathdev.com:443/forums/thread/29077.aspx</link><pubDate>Sat, 31 May 2008 03:33:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:29077</guid><dc:creator>$Charlie</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/29077.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=29077</wfw:commentRss><description>&lt;p&gt;Hi Guys, Im new to this forum and new to InfoPath...&lt;/p&gt;
&lt;p&gt;I have written the function below which uses a secondary datasource(Project Metrics Retrieval) to populate fields in my form. This should match the project name in the form text box with the project name in the SharePoint list, then output the project agreed budget for that project.&lt;/p&gt;
&lt;p&gt;Hope my code makes sense(new to coding).&lt;/p&gt;
&lt;p&gt;function projectNameEqualsExistingProject()&lt;br /&gt;{&lt;br /&gt;var doc = XDocument.DataObjects(&amp;quot;Project Metrics Retrieval&amp;quot;).DOM;&lt;/p&gt;
&lt;p&gt;doc.setProperty(&amp;quot;SelectionNamespaces&amp;quot;,&amp;#39;xmlns:dfs=&amp;quot;http://schemas.microsoft.com/office/infopath/2003/dataFormSolution&amp;quot; &amp;#39; + &amp;#39; xmlns:d=&amp;quot;http://schemas.microsoft.com/office/infopath/2003/ado/dataFields&amp;quot;&amp;#39;); &lt;/p&gt;
&lt;p&gt;&amp;nbsp;var selectedField = XDocument.DOM.selectSingleNode(&amp;quot;//my:projectName&amp;quot;).text;&lt;/p&gt;
&lt;p&gt;var selectedNode = doc.selectSingleNode(&amp;quot;/dfs:myFields/dfs:dataFields/dfs:Project_Metrics_Library/@Project_Name=[&amp;#39;selectedField&amp;#39;]&amp;quot;); &lt;/p&gt;
&lt;p&gt;XDocument.DOM.selectSingleNode(&amp;quot;//my:ProjectAgreedBudget&amp;quot;).text = selectedNode.getAttribute.getNamedItem(&amp;quot;ProjectAgreedBudget&amp;quot;);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;The error i get is below:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Expected token &amp;#39;EOF&amp;#39; found &amp;#39;=&amp;#39;.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;/dfs:myFields/dfs:dataFields/dfs:Project_Metrics_Library/@Project_Name--&amp;gt;=&amp;lt;--[&amp;#39;selectedField&amp;#39;]&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I would also like to ask if there is a need to put a loop in there to navigate the list and look for the project name, or the this will automatically search for the project name?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks in advance...&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>