<?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: Secondary Datasource Jscript Query Causing Infopath to Crash</title><link>https://www.infopathdev.com:443/forums/thread/36646.aspx</link><pubDate>Tue, 06 Jan 2009 17:07:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36646</guid><dc:creator>talexander</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36646.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=36646</wfw:commentRss><description>&lt;p&gt;This code is actually at the top of my file.&amp;nbsp; It is only called once,&amp;nbsp;and since YeastStorage is the only variable I use again (and actually I am not even using that right now), I store that globally, and discard the rest.&amp;nbsp; The delete line does not need to be in there...it crashes with or without it, I just wanted to see if that would help.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I do have code that runs on context change in the master detail section, but it does not involve the connection or code above.&amp;nbsp; The only time the variable I save with the code is used is when I click my query button, and the code is never used again.&lt;/p&gt;
&lt;p&gt;Infopath may crash sometimes when you click quickly between entries, but in this case it is stable without the code mentioned, and with the code it crashes fairly quickly every time I am clicking around...I would say between 10 and 20 changes will cause it to crash.&lt;/p&gt;
&lt;p&gt;Here is the code that runs when I change my Master/Detail selection:&lt;/p&gt;
&lt;p&gt;function XDocument::OnContextChange(eventObj) &lt;/p&gt;
&lt;p&gt;{ &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;if (eventObj.Type == &amp;quot;ContextNode&amp;quot;) &lt;/p&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;{ &lt;/p&gt;
&lt;p&gt;// Selection or context in the form has changed. Write your code here to respond to the changes. &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;if (gstrSelectedUniqueId != getSelectedUniqueId()) &lt;/p&gt;
&lt;p&gt;{ &lt;/p&gt;
&lt;p&gt;gstrSelectedUniqueId = getSelectedUniqueId(); &lt;/p&gt;
&lt;p&gt;if (null != gstrSelectedUniqueId) &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;if (&amp;quot;&amp;quot; == gstrSelectedUniqueId) &lt;/p&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;refreshDataConnection(&amp;quot;Generation&amp;quot;, null);&lt;/p&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;p&gt;&amp;nbsp;else &lt;/p&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;refreshDataConnection(&amp;quot;Generation&amp;quot;, new Array([/(VesselID\s)(IS\sNULL)/, &amp;quot;$1 = &amp;quot; + gstrSelectedUniqueId])); &lt;/p&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;&amp;nbsp;}&amp;nbsp;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;}&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;}&lt;/p&gt;
&lt;p&gt;The functions in the code get the ID of the master entry that I am on, replace NULL with that ID in the query for the &amp;quot;Generation&amp;quot; connection, and rerun the query for that connection.&amp;nbsp; It is a recursive query that returns an integer that counts the interations and nothing else.&amp;nbsp; The highest number of iterations it does for this specific form is 11, and the query runs extremely quickly when I run it on its own.&lt;/p&gt;
&lt;p&gt;I will try the other syntax for accessing the secondary connection data, and see if that helps.&lt;/p&gt;</description></item><item><title>Re: Secondary Datasource Jscript Query Causing Infopath to Crash</title><link>https://www.infopathdev.com:443/forums/thread/36602.aspx</link><pubDate>Tue, 06 Jan 2009 09:48:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36602</guid><dc:creator>Shiva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36602.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=36602</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;InfoPath will crash some times, if you click on quickly on repeating master detail section. We are trying to display other detail section without showing the selected detail section. Sometime if we click twice on disable button then InfoPath form will crash. &lt;/p&gt;
&lt;p&gt;The above code will run in on after change event of repeating node? Do you have any code for repeating section? What is the functionality of master detail section? Are you trying to connect Jscript while doing any changes in master detail section?&lt;/p&gt;</description></item><item><title>Re: Secondary Datasource Jscript Query Causing Infopath to Crash</title><link>https://www.infopathdev.com:443/forums/thread/36594.aspx</link><pubDate>Tue, 06 Jan 2009 04:35:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36594</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36594.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=36594</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m not sure why that error is happening, but I can tell you that you shouldn&amp;#39;t be setting the selection namespaces on the secondary DOM every time a function is called.&amp;nbsp; They should be set once globally and left that way.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m used to accessing the secondary DOM with XDocument.DataObjects[&amp;quot;&lt;em&gt;DomName&lt;/em&gt;&amp;quot;].DOM rather than XDocument.GetDOM(&amp;quot;&lt;em&gt;DomName&lt;/em&gt;&amp;quot;).&amp;nbsp; I&amp;#39;m not sure if one&amp;#39;s better than the other, but you could try both and see if one of them stops the error from happening.&lt;/p&gt;
&lt;p&gt;Also, there should be no need to use the &lt;em&gt;delete&lt;/em&gt; keyword anywhere in your code.&lt;/p&gt;
&lt;p&gt;Please try out some of the above and see if that helps.&lt;/p&gt;</description></item><item><title>Secondary Datasource Jscript Query Causing Infopath to Crash</title><link>https://www.infopathdev.com:443/forums/thread/36592.aspx</link><pubDate>Tue, 06 Jan 2009 01:22:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36592</guid><dc:creator>talexander</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36592.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=36592</wfw:commentRss><description>&lt;p&gt;I am using this code in jscript to get info from a secondary datasource:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;var YeastStoragedom = XDocument.GetDOM(&amp;quot;YeastStorageStateID&amp;quot;);&lt;/p&gt;
&lt;p&gt;YeastStoragedom.setProperty(&amp;quot;SelectionNamespaces&amp;quot;,&amp;#39;xmlns:dfs = &amp;quot;http://schemas.microsoft.com/office/infopath/2003/dataFormSolution&amp;quot; xmlns:d = &amp;quot;http://schemas.microsoft.com/office/infopath/2003/ado/dataFields&amp;quot;&amp;#39;); &lt;/p&gt;
&lt;p&gt;var YeastStorage = YeastStoragedom.selectSingleNode(&amp;quot;dfs:myFields/dfs:dataFields/d:VesselState/@VesselStateID&amp;quot;).text; &lt;/p&gt;
&lt;p&gt;delete YeastStoragedom;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The YeastStorageStateID query returns only one row, and YeastStorage is set to an integer identifier for the vessel state Yeast Storage, which happens to equal 6.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I later adjust my main connection query to return only vessels with this state ID.&amp;nbsp; So far, all this code works.&amp;nbsp; I can search for only this ID, or for all ID&amp;#39;s without trouble.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The search populates a Master/Detail table in my Infopath form, and the problem comes when I try click on different entries in the master table.&amp;nbsp; After clicking between several different entries, especially if I click quickly, Infopath crashes.&amp;nbsp; The error signature looks like this:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;AppName: infopath.exe&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AppVer: 11.0.8165.0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AppStamp:46365a13&lt;/p&gt;
&lt;p&gt;ModName: mshtml.dll&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ModVer: 7.0.6000.16788&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ModStamp:494358c0&lt;/p&gt;
&lt;p&gt;fDebug: 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Offset: 00216eac&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then an Application Error dialogue box pops up that says:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The instruction at &amp;quot;0x437e6eac&amp;quot; referenced memory at &amp;quot;0x00000000&amp;quot;.&amp;nbsp; The memory could not be &amp;quot;read&amp;quot;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If I hardwire the query in my code, excluding vessels that do not have a State ID equal to 6, and take out the code above, Infopath does not crash.&amp;nbsp; However, if I keep the code in, even if I keep the query hardwired and never use the variable YeastStorage again, the program crashes.&amp;nbsp; It also crashes without the &amp;quot;delete YeastStoragedom;&amp;quot; line; I just put that in to see if it would fix the problem.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What am I doing wrong?&lt;/p&gt;</description></item></channel></rss>