<?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>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Disable Save fetaure based on the changing of a drop down value.</title><link>https://www.infopathdev.com:443/forums/thread/30996.aspx</link><pubDate>Tue, 29 Jul 2008 18:23:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30996</guid><dc:creator>e_stylzz</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30996.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30996</wfw:commentRss><description>&lt;p&gt;The following solution was thanks to Hilary Stoupa, Thank you!:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I had to to create a boolean field first that would assist in the operation.&amp;nbsp; Then I created to event handlers.&amp;nbsp; One for the dropdownlist, and onAfterChange event, and one for saving, onSaveRequest.&amp;nbsp; Here is the code I used for the two of them:&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt; ddlEngagementType_OnAfterChange(&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;DataDOMEvent&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt; e)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//checks to see if the engagement type has changed from New to Extension. If so, it sets a boolean field to true&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//which will later disable save forcing a submit only. This prevents saving new extensions over current new project announcements.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Write your code here to restore the global state.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (e.IsUndoRedo)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// An undo or redo operation has occurred and the DOM is read-only.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;return&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// A field change has occurred and the DOM is writable.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Write your code here.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (e.OldValue != &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;null&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//set variables to hold the old value and the new value of the field&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; newValue = e.NewValue.ToString();&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; oldValue = e.OldValue.ToString();&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//if the field used to have the value of new and now has the value of extension, move into the next code block&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (oldValue.ToLower().Equals(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;new&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;) &amp;amp;&amp;amp; newValue.ToLower().Equals(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;extension&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;))&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//set our helper field to &amp;quot;true&amp;quot;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;thisXDocument.DOM.selectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:myFields/my:ddlEngagementType/@my:bEngagementType&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;).text = &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;true&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;/p&gt;}&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; FormEvents_OnSaveRequest(&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;SaveEvent&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; e)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//This checks the value of the helper boolean to determine if any of the triggers went off to disable save&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Write your code that will run before a Save or Save As operation here.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//get the values of the drop down and the helper node&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; ddlValue = thisXDocument.DOM.selectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:myFields/my:ddlEngagementType&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;).text;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; helper = thisXDocument.DOM.selectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:myFields/my:ddlEngagementType/@my:bEngagementType&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;).text;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//check to see if our helper node is true -- if it is, and if the value of the drop down is &amp;quot;extension&amp;quot;, don&amp;#39;t allow saving&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;Convert&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.ToBoolean(helper) &amp;amp;&amp;amp; ddlValue.ToLower().Equals(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;extension&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;))&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;thisXDocument.UI.Alert(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;You can&amp;#39;t save the form because you changed the status from new to extension&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;e.ReturnStatus = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;else&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;e.IsCancelled = e.PerformSaveOperation();&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Write your code to be run after saving here.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;e.ReturnStatus = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hope this helps.&amp;nbsp; Thanks to all who contributed!&lt;/p&gt;
&lt;p&gt;Eric&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Disable Save fetaure based on the changing of a drop down value.</title><link>https://www.infopathdev.com:443/forums/thread/30921.aspx</link><pubDate>Mon, 28 Jul 2008 16:41:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30921</guid><dc:creator>e_stylzz</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30921.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30921</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Yeah, thats how I figured out this was for 2007.&amp;nbsp; When I had 2003 compatible C#, the changed event was not available, but when i changed it to plain C# it became avaialble.&amp;nbsp; Is there anyway to do this in 2003 and would anyone be willing to volunteer the code if so?&amp;nbsp; I have a few books on the way, but this project is supposed to go live on Monday and I don&amp;#39;t think i&amp;#39;ll know that much by then.&amp;nbsp; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Disable Save fetaure based on the changing of a drop down value.</title><link>https://www.infopathdev.com:443/forums/thread/30917.aspx</link><pubDate>Mon, 28 Jul 2008 16:04:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30917</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30917.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30917</wfw:commentRss><description>&lt;p&gt;The code you are using is for the 2007 object model, to begin with. It will not work with the 2003 object model. Also, the code includes the event handlers, which you will need to add to&amp;nbsp;your form and then use the code from the sample in the event handler you create. &lt;a href="http://msdn.microsoft.com/en-us/library/aa947848(VS.80).aspx"&gt;Here&lt;/a&gt; is an article on that.&lt;/p&gt;</description></item><item><title>Re: Disable Save fetaure based on the changing of a drop down value.</title><link>https://www.infopathdev.com:443/forums/thread/30916.aspx</link><pubDate>Mon, 28 Jul 2008 15:55:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30916</guid><dc:creator>e_stylzz</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30916.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30916</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Looks like this has to be done in 2007 to use this code.&amp;nbsp; Any way to do this in 2003 or with 2003 compatible code?&amp;nbsp; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Disable Save fetaure based on the changing of a drop down value.</title><link>https://www.infopathdev.com:443/forums/thread/30903.aspx</link><pubDate>Mon, 28 Jul 2008 12:14:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30903</guid><dc:creator>e_stylzz</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30903.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30903</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hilary, thanks for your patience.&amp;nbsp; I understand what you mean now and got that poriton setup.&amp;nbsp; I&amp;#39;m still getting run time errors with XmEventArgs and SaveEventArgs however.&amp;nbsp; They have the green squigley line under it and it says this when I rollover it:&amp;nbsp; &amp;quot;The type or namespace name &amp;#39;&lt;i&gt;XmlEventArgs&lt;/i&gt;&amp;#39; could not be found (are you missing a using directive or an assembly reference?)&lt;/p&gt;&lt;p&gt;I&amp;#39;m using C#(InfoPath 2003 Compatible) &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Disable Save fetaure based on the changing of a drop down value.</title><link>https://www.infopathdev.com:443/forums/thread/30872.aspx</link><pubDate>Fri, 25 Jul 2008 21:22:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30872</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30872.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30872</wfw:commentRss><description>&lt;p&gt;I realize you are just copying and pasting the code provided earlier. That code depends upon you having a boolean field that can be set to &amp;quot;true&amp;quot; when certain conditions are met. You don&amp;#39;t have to add a control, you can just add another node to your schema in the Data Source Task Pane, and set its datatype&amp;nbsp;to be a boolean. &lt;a href="http://office.microsoft.com/en-us/infopath/HP010967521033.aspx"&gt;Here&lt;/a&gt; are some instructions on how to do that. &lt;/p&gt;</description></item><item><title>Re: Disable Save fetaure based on the changing of a drop down value.</title><link>https://www.infopathdev.com:443/forums/thread/30871.aspx</link><pubDate>Fri, 25 Jul 2008 21:14:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30871</guid><dc:creator>e_stylzz</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30871.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30871</wfw:commentRss><description>I&amp;#39;m not sure what that field is though (the helper field).&amp;nbsp; I&amp;#39;m just copying and pasting code that was provider earlier in this post.&amp;nbsp; Do i need to add a control of some sort?&amp;nbsp;</description></item><item><title>Re: Disable Save fetaure based on the changing of a drop down value.</title><link>https://www.infopathdev.com:443/forums/thread/30870.aspx</link><pubDate>Fri, 25 Jul 2008 20:37:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30870</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30870.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30870</wfw:commentRss><description>&lt;p&gt;Any place you see XPATH to Reference Variable, you need to replace those words with the xpath to your field. To get that, you can right click on the field in the data source and select &lt;strong&gt;Copy XPath&lt;/strong&gt;. When I read this code, it tells me that in the Changed event for your drop down, if the drop down changes from &amp;quot;new&amp;quot; to &amp;quot;extension&amp;quot;, another field is having its value set to &amp;quot;true&amp;quot; -- kind of&amp;nbsp; a helper field, if you will. XPATH to Reference Variable should be replaced with the XPath to that field.&lt;/p&gt;</description></item><item><title>Re: Disable Save fetaure based on the changing of a drop down value.</title><link>https://www.infopathdev.com:443/forums/thread/30869.aspx</link><pubDate>Fri, 25 Jul 2008 20:32:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30869</guid><dc:creator>e_stylzz</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30869.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30869</wfw:commentRss><description>&lt;u&gt;&lt;strong&gt;Are you refering this this line?:&lt;/strong&gt;&lt;/u&gt;&amp;nbsp; &lt;font size="2"&gt;
&lt;p&gt;root.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;XPATH to ReferenceVariable&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).SetValue(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;true&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;); &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;&lt;u&gt;&amp;nbsp;My entire coding is such:&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; ddlEngagementType_Changed(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;object&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; sender, XmlEventArgs e) &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;{ &lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; oldValue = e.OldValue;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//collect the Old Value form Status drop down &lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; newValue = e.NewValue;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//collect the New Value form Status drop down &lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//Check if the user changes the Drop down value from new to extension then only dont allow save otherwise let him for saving. &lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (oldValue.ToLower() == &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;new&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &amp;amp;&amp;amp; newValue.ToLower() == &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;extension&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;) &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;{ &lt;/p&gt;
&lt;p&gt;XPathNavigator root = MainDataSource.CreateNavigator(); &lt;/p&gt;root.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;XPATH to ReferenceVariable&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).SetValue(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;true&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;); &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//if the status changes, then set the referrence variable value to true. &lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;} &lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; FormEvents_Save(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;object&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; sender, SaveEventArgs e) &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;{ &lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//while saving the form,check if the reference variable is true. &lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//if true, dont allow user to save the form. &lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;XPathNavigator root = MainDataSource.CreateNavigator(); &lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; ddlEngagementTypeValue = root.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;//my:ddlEngagementType&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).Value; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;XPathNavigator root = MainDataSource.CreateNavigator(); &lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; isTrue = root.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;XPATH to ReferenceVariable&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).Value; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;Convert&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.ToBoolean(isTrue)) &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;{ &lt;/p&gt;
&lt;p&gt;e.CancelableArgs.Cancel = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;; &lt;/p&gt;e.CancelableArgs.Message = &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;U Cant Save&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;e.CancelableArgs.MessageDetails = &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;U cant save as the status is Extension&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;; &lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//if ddlStatus is Extension Don’t allow the user to save the form &lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;} &lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Not sure what I&amp;#39;m looking for here.&amp;nbsp; I can do HTML but this stuff is a strech for me :-)&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;</description></item><item><title>Re: Disable Save fetaure based on the changing of a drop down value.</title><link>https://www.infopathdev.com:443/forums/thread/30867.aspx</link><pubDate>Fri, 25 Jul 2008 20:11:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30867</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30867.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30867</wfw:commentRss><description>&lt;p&gt;You replace &amp;quot;XPATH to ReferenceVariable&amp;quot; with the xpath to the field you&amp;#39;ve added as boolean. Earlier, in the code connected to the drop down box, you set the value of a boolean field to true if certain conditions are met. The xpath to that field needs to go in quotes in place of the phrase &amp;quot;XPATH to ReferenceVariable&amp;quot;.&lt;/p&gt;</description></item><item><title>Re: Disable Save fetaure based on the changing of a drop down value.</title><link>https://www.infopathdev.com:443/forums/thread/30864.aspx</link><pubDate>Fri, 25 Jul 2008 20:05:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30864</guid><dc:creator>e_stylzz</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30864.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30864</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;I can&amp;#39;t give up that easily.&amp;nbsp; So I got Infopath 2007 and switched it to C# and I have inserted the code you supplied inserting the xpath to the dropdownlist.&amp;nbsp; One part i&amp;#39;m unsure of in your code is the xpath to the referencevariable.&amp;nbsp; what does that mean and what is it?&lt;/p&gt;&lt;p&gt;Ex: string isTrue = root.SelectSingleNode(&amp;quot;XPATH to ReferenceVariable&amp;quot;, NamespaceManager).Value;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Also, I get &amp;quot;The type or namespace name &amp;#39;XMLEventArgs&amp;#39; and &amp;#39;SaveEventArgs&amp;#39; could not be found.&amp;quot; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Disable Save fetaure based on the changing of a drop down value.</title><link>https://www.infopathdev.com:443/forums/thread/30805.aspx</link><pubDate>Thu, 24 Jul 2008 20:47:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30805</guid><dc:creator>e_stylzz</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30805.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30805</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Thanks for all your help but we can close this.&amp;nbsp; Since the users are opening the document from sharepoint and making the changes, even if we disable save, it&amp;#39;s still going to prompt to save after they submit because the file has changes.&amp;nbsp; I just don&amp;#39;t see anyway to get that to work. &amp;nbsp; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Disable Save fetaure based on the changing of a drop down value.</title><link>https://www.infopathdev.com:443/forums/thread/30801.aspx</link><pubDate>Thu, 24 Jul 2008 19:32:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30801</guid><dc:creator>e_stylzz</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30801.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30801</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Srikrushna&lt;/p&gt;&lt;p&gt;I&amp;#39;m starting to get the feeling this is specific to Infopath 2007.&amp;nbsp; Since I see C# listed in Infopath 2007 and it looks like the XmlEventArgs are part of the Microsoft.Office.Infopath namespace which MSDN says is in 2007.&amp;nbsp; I dont know what any of that means but I have a bad feeling in my stomach.&amp;nbsp; Can this be done in VBScript in 2003?&amp;nbsp;&amp;nbsp;&amp;nbsp; Thanks to anyone and everyone who reads this.&lt;/p&gt;&lt;p&gt;Eric &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Disable Save fetaure based on the changing of a drop down value.</title><link>https://www.infopathdev.com:443/forums/thread/30797.aspx</link><pubDate>Thu, 24 Jul 2008 19:00:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30797</guid><dc:creator>e_stylzz</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30797.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30797</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;C#?&amp;nbsp; I only have JS and VBScript listed.&amp;nbsp; What do i do?&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Disable Save fetaure based on the changing of a drop down value.</title><link>https://www.infopathdev.com:443/forums/thread/30795.aspx</link><pubDate>Thu, 24 Jul 2008 18:50:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30795</guid><dc:creator>e_stylzz</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30795.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30795</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Sorry, I freaked out beore looking around.&amp;nbsp; Found my problem here:&amp;nbsp; http://support.microsoft.com/default.aspx?kbid=828853&lt;/p&gt;&lt;p&gt;Thanks guys.&amp;nbsp; I&amp;#39;ll test the code and let you know. &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>