<?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: Getting a reference to datafields in script</title><link>https://www.infopathdev.com:443/forums/thread/3050.aspx</link><pubDate>Tue, 22 Aug 2006 22:55:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3050</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3050.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3050</wfw:commentRss><description>Glad to help!</description></item><item><title>Re: Getting a reference to datafields in script</title><link>https://www.infopathdev.com:443/forums/thread/3049.aspx</link><pubDate>Tue, 22 Aug 2006 07:52:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3049</guid><dc:creator>henk</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3049.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3049</wfw:commentRss><description>Thanks Greg</description></item><item><title>Re: Getting a reference to datafields in script</title><link>https://www.infopathdev.com:443/forums/thread/3048.aspx</link><pubDate>Mon, 21 Aug 2006 18:41:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3048</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3048.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3048</wfw:commentRss><description>XDocument.DOM refers to the MAIN data source. When you start with a blank form and add the connection later, you are now working with a SECONDARY data source. You cannot access a secondary data source via XDocument.DOM. Instead you need to use XDocument.GetDOM("Name of Data Source").selectNodes(...);</description></item><item><title>Getting a reference to datafields in script</title><link>https://www.infopathdev.com:443/forums/thread/1507.aspx</link><pubDate>Mon, 21 Aug 2006 09:30:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:1507</guid><dc:creator>henk</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/1507.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=1507</wfw:commentRss><description>Hi everyone, &lt;br /&gt;I'm using a web service to recieve data for my IP form. &lt;br /&gt;In my script I reference these fields to get values to submit via a SQL stored procedure. &lt;br /&gt;My problem is, when I go design form --&amp;gt; new from data connection, I can get a reference to these datafields and work with them. However when I go new blank form and then add the data connection afterwards I just can't get a reference. Designing with "new from data connection" would have been fine if it wasn't for the "Query" button that you have to click to get your data on the form. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is a short extract of my script (gets a reference to the datafield "ID" and displays the count of records):&lt;br /&gt;&lt;br /&gt;var nodes = XDocument.DOM.selectNodes("/dfs:myFields/dfs:dataFields/tns:GetQuestionObjectsResponse/tns:GetQuestionObjectsResult/tns:Question/tns:ID");&lt;br /&gt;	XDocument.UI.Alert(nodes.length);&lt;br /&gt;	eventObj.ReturnStatus = true;&lt;br /&gt;&lt;br /&gt;when using "new from data connection" it displays the correct number, but with "new blank form" and connection added later it is just 0. &lt;br /&gt;&lt;br /&gt;Please if anyone can give me advice I would really appreciate it...&lt;br /&gt;Thanks!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</description></item></channel></rss>