<?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>Data Connections</title><link>https://www.infopathdev.com:443/forums/44.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: scarse information on passing parameter to a secondary datasource (set up as web service)</title><link>https://www.infopathdev.com:443/forums/thread/27061.aspx</link><pubDate>Thu, 06 Mar 2008 21:43:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:27061</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/27061.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=44&amp;PostID=27061</wfw:commentRss><description>&lt;p&gt;You cannot programmatically get at anything in the view... however, since the section uses conditional formatting, there is some formula it is using to decide whether it is hidden. You can use this same formula in your code to decide whether the section is hidden. Make sense?&lt;/p&gt;
&lt;p&gt;If the formula is too complex, then you might be able to add another node somewhere that calculates its value based on the formula (i.e. a Boolean true/false or 1/0). Then the conditional formatting simply looks at the value of this addtional fields, and the code can do the same.&lt;/p&gt;</description></item><item><title>Re: scarse information on passing parameter to a secondary datasource (set up as web service)</title><link>https://www.infopathdev.com:443/forums/thread/27029.aspx</link><pubDate>Wed, 05 Mar 2008 22:56:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:27029</guid><dc:creator>knudde</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/27029.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=44&amp;PostID=27029</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Evening Greg,&amp;nbsp; maybe you know how to query for the following..&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;img src="http://users.pandora.be/youyounet/Infopath_issues/infopath1.png" title="selection box hidden" alt="selection box hidden" height="399" width="1115" /&gt;&lt;/p&gt;&lt;p&gt;From the screenshot in the thread above, you can see that sometimes the checkbox is not there, depending on the age of the hardware in that list.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I set this up with a section where i&amp;#39;ve placed the check box in. And with the conditional formatting, i worked it out to hide or show the Section and thus the incorporated checkbox. (if &amp;#39;current machine is X then hide etc..)&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;My Q:&amp;nbsp; can you programmatoricaly check for the &amp;#39;visibility&amp;#39; of this &amp;quot;Section&amp;quot;?&amp;nbsp; is this an attribute that you can query upon?&amp;nbsp; Mine are called Section2 and Section3&amp;nbsp; - very distinguishable.. Ooo&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The fun is still around&amp;nbsp;&lt;/p&gt;&lt;p&gt;tnxs&lt;/p&gt;&lt;p&gt;K&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: scarse information on passing parameter to a secondary datasource (set up as web service)</title><link>https://www.infopathdev.com:443/forums/thread/26983.aspx</link><pubDate>Tue, 04 Mar 2008 17:26:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:26983</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/26983.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=44&amp;PostID=26983</wfw:commentRss><description>&lt;p&gt;Glad that you got it figured out and working! It starts to get fun once it all comes together. Not that you won&amp;#39;t have challenging tasks and big struggles, but it&amp;#39;s still fun!&lt;/p&gt;</description></item><item><title>Re: scarse information on passing parameter to a secondary datasource (set up as web service)</title><link>https://www.infopathdev.com:443/forums/thread/26953.aspx</link><pubDate>Mon, 03 Mar 2008 22:54:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:26953</guid><dc:creator>knudde</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/26953.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=44&amp;PostID=26953</wfw:commentRss><description>&lt;p&gt;var nodes=XDocument.DOM.selectNodes(&amp;quot;/my:myFields/my:R_group/my:RT_directreports&amp;quot;) //feth all records for (var i=0; itnxs for the tips Greg.&lt;/p&gt;
&lt;p&gt;after a long and tedious trial and error, i worked it out.&lt;/p&gt;
&lt;p&gt;2 errors i made&lt;/p&gt;
&lt;p&gt;&lt;b&gt;a) webs.selectSingleNode(&amp;quot;/dfs:myFields/dfs:queryFields/tns:Landesk_list/tns:StrUser&amp;quot;).text=Strname&amp;nbsp; &lt;/b&gt;was the correct one, i was missing a &amp;#39;tns&amp;#39;. I exported the infopath form locally and looked into the forms for the service setup to get that info.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;b) I needed to query the Adapter, not the DOM.&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I recreated the webservice onto&amp;nbsp;a different virtual directory to cut out the Oracle namespace i was carrying along on my webservices. It was pointing to a SQL server anyway. so the namespace changed to ns2 instead of tns&lt;/p&gt;
&lt;p&gt;In case it helps anyway struggeling. here&amp;#39;s the code i used&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;--------------------------------------------------------------------------&lt;/p&gt;
&lt;p&gt;var nodes=XDocument.DOM.selectNodes(&amp;quot;/my:myFields/my:R_group/my:RT_directreports&amp;quot;)&amp;nbsp;&amp;nbsp; &amp;nbsp;//fetch all records&amp;nbsp; from the repeating table in infopath&lt;/p&gt;
&lt;p&gt;for (var i=0; i&amp;lt;nodes.length;i++)&amp;nbsp;&amp;nbsp; //and start looping&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;{ &lt;/p&gt;
&lt;p&gt;var machina = nodes(i).selectSingleNode(&amp;quot;my:F_Currentmach&amp;quot;).text;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;if (machina == &amp;quot;n.a.&amp;quot;) &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&amp;nbsp;var Strname = nodes(i).selectSingleNode(&amp;quot;my:F_Firstname&amp;quot;).text+&amp;quot;.&amp;quot;+nodes(i).selectSingleNode(&amp;quot;my:F_Lastname&amp;quot;).text;&amp;nbsp;&amp;nbsp;&amp;nbsp; // i want to hunt for machines logged on by &amp;quot;firstname.lastname&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;var websobj=XDocument.DataObjects[&amp;quot;list_machines&amp;quot;] ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //list_machines is the name of my secondary data service&lt;/p&gt;
&lt;p&gt;websDOM=websobj.DOM &lt;/p&gt;
&lt;p&gt;websDOM.setProperty(&amp;quot;SelectionNamespaces&amp;quot;,&amp;#39;xmlns:xsd=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:dfs=&amp;quot;http://schemas.microsoft.com/office/infopath/2003/dataFormSolution&amp;quot; xmlns:ns2=&amp;quot;http://tempuri.org/&amp;quot;&amp;#39;);&lt;/p&gt;
&lt;p&gt;var oUser=websDOM.selectSingleNode(&amp;quot;/dfs:myFields/dfs:queryFields/ns2:Landesk_list/ns2:StrUser&amp;quot;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //this is my input parameter&lt;/p&gt;
&lt;p&gt;oUser.text=Strname &lt;/p&gt;
&lt;p&gt;var Adapter= XDocument.DataObjects[&amp;quot;list_machines&amp;quot;].QueryAdapter; &lt;/p&gt;
&lt;p&gt;Adapter.Query();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //fire off&amp;nbsp;the query to the webservice&lt;/p&gt;
&lt;p&gt;XDocument.GetDOM(&amp;quot;list_machines&amp;quot;).setProperty(&amp;quot;SelectionNamespaces&amp;quot;,&amp;#39;xmlns:xsd=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:dfs=&amp;quot;http://schemas.microsoft.com/office/infopath/2003/dataFormSolution&amp;quot; xmlns:ns2=&amp;quot;http://tempuri.org/&amp;quot;&amp;#39;);&lt;/p&gt;
&lt;p&gt;&amp;nbsp; var nodes2=XDocument.GetDOM(&amp;quot;list_machines&amp;quot;).selectNodes(&amp;quot;/dfs:myFields/dfs:dataFields/ns2:Landesk_listResponse/ns2:Landesk_listResult/NewDataSet/Table&amp;quot;);&amp;nbsp;&amp;nbsp; //read all nodes returned by the webservice&lt;/p&gt;
&lt;p&gt;var allmachines=&amp;quot;&amp;quot; &lt;/p&gt;
&lt;p&gt;for (var j=0; j&amp;lt;nodes2.length;j++)&lt;/p&gt;
&lt;blockquote dir="ltr" style="margin-right:0px;"&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;var machines=nodes2(j).selectSingleNode(&amp;quot;Make&amp;quot;).text+&amp;quot; &amp;quot;+nodes2(j).selectSingleNode(&amp;quot;model&amp;quot;).text &lt;/p&gt;
&lt;p&gt;allmachines=allmachines +&amp;quot; &amp;quot;+machines&lt;/p&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;}&lt;/p&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;nodes(i).selectSingleNode(&amp;quot;my:F_Currentmach&amp;quot;).text=allmachines&lt;/p&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;nbsp;}&lt;/p&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;}&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;In case you&amp;#39;re wondering what i was trying to do.. &lt;/p&gt;
&lt;p&gt;step A is to fetch machineinfo for a selected user from a secondary webservice.&lt;/p&gt;
&lt;p&gt;step B is to attempt to locate machine for those who&amp;#39;re not recorded by lookign to the the log in info on a differnt server (the &amp;#39;no data available&amp;#39;)&lt;/p&gt;
&lt;p&gt;based on machine, the age is set and based on that age, one or more checkboxes get hidden (no upgrade possible)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://users.pandora.be/youyounet/Infopath_issues/infopath.png" style="width:730px;height:316px;" height="316" width="730" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;tnxs for your willingness to help Greg&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Gee, i start to like the coding now..&lt;/p&gt;
&lt;p&gt;K&lt;/p&gt;</description></item><item><title>Re: scarse information on passing parameter to a secondary datasource (set up as web service)</title><link>https://www.infopathdev.com:443/forums/thread/26944.aspx</link><pubDate>Mon, 03 Mar 2008 18:59:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:26944</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/26944.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=44&amp;PostID=26944</wfw:commentRss><description>&lt;p&gt;&lt;b&gt;webs.selectSingleNode(&amp;quot;/dfs:myFields/dfs:queryFields/tns:Landesk_list/StrUser&amp;quot;).text=Strname;&lt;/b&gt; &lt;br /&gt;&lt;b&gt;webs.Query();&amp;nbsp;&lt;/b&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Make sure that you are getting a valid node back before trying to set the node value. It could be that there is something wrong with the XPath or some other issue with the selection that is causing a null value to be returned. And you cannot do (null object).text=Strname... that just won&amp;#39;t work.&lt;/p&gt;
&lt;p&gt;If you need to do a quick test to make sure it&amp;#39;s working at all. Add the StrUser field to a view along with a button that requeries that web service. Then you can type in a value and click the button to make sure that it is at least working right.&lt;/p&gt;</description></item><item><title>scarse information on passing parameter to a secondary datasource (set up as web service)</title><link>https://www.infopathdev.com:443/forums/thread/26922.aspx</link><pubDate>Mon, 03 Mar 2008 00:13:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:26922</guid><dc:creator>knudde</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/26922.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=44&amp;PostID=26922</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;past midnight again so it time to stop googling and ask the experts.&lt;/p&gt;&lt;p&gt;there is very scarse information to be found on how to pass a parameter to a secondary webservice - that is set up as a webservice- so i cant get my head around the correct syntax&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;here s the story&lt;/p&gt;&lt;p&gt;a) my other secondary webservices work fine and pull data across and fill my tables.&lt;/p&gt;&lt;p&gt;I want to then secondary check the tables and recheck the ones that have a &amp;quot;n.a.&amp;quot; value and thus check on a different database if they might have some information&lt;/p&gt;&lt;p&gt;to do that, i put the (F_firstname)+ (F_lastname) in a variable StrName (this all works fine, no worries here) and want to pass this to my secondary datasource (&amp;quot;list_machines&amp;quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;img src="http://users.pandora.be/youyounet/Infopath_issues/infopath3.png" height="241" width="293" alt="" /&gt;&lt;/p&gt;&lt;p&gt;if (machina == &amp;quot;n.a.&amp;quot;)
		&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt; 
		var Strname = nodes(i).selectSingleNode(&amp;quot;my:F_Firstname&amp;quot;).text+&amp;quot;.&amp;quot;+nodes(i).selectSingleNode(&amp;quot;my:F_Lastname&amp;quot;).text;
		&lt;/p&gt;&lt;p&gt;XDocument.UI.Alert(Strname);
				
		&lt;/p&gt;&lt;p&gt;var webs=XDocument.DataObjects[&amp;quot;list_machines&amp;quot;].DOM ;&lt;/p&gt;&lt;p&gt;
		webs.setProperty(&amp;quot;SelectionNamespaces&amp;quot;,&amp;#39;xmlns:tns=&amp;quot;http://Office2003/Oracle&amp;quot; xmlns:dfs=&amp;quot;http://schemas.microsoft.com/office/infopath/2003/dataFormSolution&amp;quot;&amp;#39;);
 
		&lt;/p&gt;&lt;p&gt;&lt;b&gt;webs.selectSingleNode(&amp;quot;/dfs:myFields/dfs:queryFields/tns:Landesk_list/StrUser&amp;quot;).text=Strname;&lt;/b&gt;
		&lt;/p&gt;&lt;p&gt;&lt;b&gt;webs.Query();&amp;nbsp;&lt;/b&gt;
	&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;it fails miserably on setting the StrUser parameter as well as to run the query again..(when i skip the parameter and take the default one set during&amp;nbsp; setup of the wbeservice) &lt;/p&gt;&lt;p&gt;Any one out there knows what to do to fix this?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;tnxs&lt;/p&gt;&lt;p&gt;K&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>