<?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>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: OnLoad problem</title><link>https://www.infopathdev.com:443/forums/thread/19853.aspx</link><pubDate>Mon, 14 May 2007 17:10:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19853</guid><dc:creator>liorlankril</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19853.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=19853</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Hi &lt;strong&gt;nukkumatti !&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;OnContextChanged happen when&amp;nbsp; I change any input in the form...... That not good becuase the user who open the form&amp;nbsp;(not new)&amp;nbsp; will be able to read the form, I even dont want him to be able to read it (only the user who open it as new form will be able to read it and write)&lt;/p&gt;</description></item><item><title>Re: OnLoad problem</title><link>https://www.infopathdev.com:443/forums/thread/19847.aspx</link><pubDate>Mon, 14 May 2007 15:26:37 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19847</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19847.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=19847</wfw:commentRss><description>You can use this in the OnContextChanged event: XDocument.View.SwitchView(&amp;quot;Access Denied&amp;quot;); //Access Denied is the name of the second view</description></item><item><title>Re: OnLoad problem</title><link>https://www.infopathdev.com:443/forums/thread/19844.aspx</link><pubDate>Mon, 14 May 2007 12:53:23 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19844</guid><dc:creator>liorlankril</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19844.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=19844</wfw:commentRss><description>hi zaphi. yes.... I did it, see me last reply befor your last one</description></item><item><title>Re: OnLoad problem</title><link>https://www.infopathdev.com:443/forums/thread/19842.aspx</link><pubDate>Mon, 14 May 2007 12:48:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19842</guid><dc:creator>zaphi</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19842.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=19842</wfw:commentRss><description>Hi liorlankril

I mean in your exemple

{ XDocument.DOM.selectSingleNode("/my:myFields/my:AllowForm").text="false"; }

because you refer to a text field.


Regards.
Philippe</description></item><item><title>Re: OnLoad problem</title><link>https://www.infopathdev.com:443/forums/thread/19841.aspx</link><pubDate>Mon, 14 May 2007 12:47:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19841</guid><dc:creator>liorlankril</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19841.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=19841</wfw:commentRss><description>&lt;p&gt;I try. &amp;quot;True/False&amp;quot; and &amp;quot;true/false&amp;quot; and even &amp;quot;0\1&amp;quot;. That&amp;#39;s not the problem:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;1) What can I do on OnLoad event&amp;nbsp;- as I said I can&amp;#39;t operate close form or switch view&lt;/p&gt;&lt;p&gt;2) i try to add rule for open the form but it happens before the OnLoad event!!!&lt;/p&gt;</description></item><item><title>Re: OnLoad problem</title><link>https://www.infopathdev.com:443/forums/thread/19840.aspx</link><pubDate>Mon, 14 May 2007 12:43:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19840</guid><dc:creator>liorlankril</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19840.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=19840</wfw:commentRss><description>&lt;p&gt;Hi zaphi!&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Sorry, I didn&amp;#39;t understamd your answer. What is &amp;quot;quotation marks in your expressions&amp;quot; ?&lt;/p&gt;</description></item><item><title>Re: OnLoad problem</title><link>https://www.infopathdev.com:443/forums/thread/19837.aspx</link><pubDate>Mon, 14 May 2007 12:19:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19837</guid><dc:creator>zaphi</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19837.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=19837</wfw:commentRss><description>Hi liorlankril

Try with "true" or "false" in quotation marks in your expressions.
Regards 
Philippe</description></item><item><title>OnLoad problem</title><link>https://www.infopathdev.com:443/forums/thread/19836.aspx</link><pubDate>Mon, 14 May 2007 11:51:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19836</guid><dc:creator>liorlankril</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19836.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=19836</wfw:commentRss><description>&lt;p&gt;I have an InfoPath Form that contain field (on main Data Source) named &amp;quot;UserLogin&amp;quot;.&lt;/p&gt;&lt;p&gt;&amp;nbsp;On it&amp;#39;s OnLoad event I do this code:&lt;/p&gt;&lt;p&gt;function XDocument::OnLoad(eventObj) &lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;nbsp;var objNetwork = new ActiveXObject(&amp;quot;WScript.network&amp;quot;);&lt;/p&gt;&lt;p&gt;&amp;nbsp;var login=objNetwork.UserName ; &lt;/p&gt;&lt;p&gt;if(XDocument.IsNew)&lt;/p&gt;&lt;p&gt;&amp;nbsp;{ &lt;/p&gt;&lt;p&gt;XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:UserLogin&amp;quot;).text=login; // Set the current user login as the value of &amp;quot;UserLogin&amp;quot;&lt;/p&gt;&lt;p&gt;} &lt;/p&gt;&lt;p&gt;else&amp;nbsp; // NOT NEW FORM&lt;/p&gt;&lt;p&gt;&amp;nbsp;{&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var existLogin=XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:UserLogin&amp;quot;).text;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (existLogin != login)&amp;nbsp; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//This is the problematic part !!!!!!!!!!!!!!!!!!!!!!!!!!&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;}&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Explain: If the form is new form I update on the &amp;quot;UserLogin&amp;quot; field to be the value of the user login that open this form.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;If the form is NOT NEW&lt;/strong&gt; - I check if the current user that open the form, is the same user that open it on the first time!!!!!!&lt;/p&gt;&lt;p&gt;&amp;nbsp;If not (the problematic part)..... I want to close the form or switch view but as I can see I cant do those operations on the OnLoad event!!!!!!&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;What can I do?&lt;/p&gt;&lt;p&gt;By the way I also try this: I add to my Data Source a boolean field called &amp;quot;AllowForm&amp;quot; (deafult value=True)&lt;/p&gt;&lt;p&gt;In me code - In the (the problematic part) I write this:&lt;/p&gt;&lt;p&gt;if (existLogin != login) { XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:AllowForm&amp;quot;).text=False; }&lt;/p&gt;&lt;p&gt;And the I go to Tools-&amp;gt; Form Options-&amp;gt; Open and Save -&amp;gt; Rules -&amp;gt; Add -&amp;gt; Set condition: &amp;quot;&lt;strong&gt;if AllowForm is equal&amp;nbsp;to&amp;nbsp;False&lt;/strong&gt;&amp;quot; -&amp;gt; Add action -&amp;gt; Switch to &amp;quot;View 2&amp;quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;It&amp;#39;s not work because this open role happen &lt;strong&gt;before &lt;/strong&gt;the OnLoad event so I AllowForm still =True!!!! and the action not operate!!!!&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Any Ideas????&lt;/p&gt;</description></item></channel></rss>