<?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: Problem in OnAfterChange code</title><link>https://www.infopathdev.com:443/forums/thread/14659.aspx</link><pubDate>Thu, 15 Jun 2006 07:32:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14659</guid><dc:creator>liorlankri</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14659.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14659</wfw:commentRss><description>Still not work. I will tell you somthing. I wanted to operate OnBeforeChange event (for this field), But I coludnt do it since in my event's code I call to a DataConnection (to a Web Service that recive paremeter) and this code line (of sending parameter to the WS):&lt;br /&gt;&lt;br /&gt;dataDom.selectSingleNode ("/dfs:myFields/dfs:queryFields/tns:EntryRequest_CheckExist/tns:strId").text=strId &lt;br /&gt;&lt;br /&gt;Can not be done since in OnBeforeChange event all the DataSource are in Read only status!!!&lt;br /&gt;&lt;br /&gt;That's why I use OnAfterChange event!</description></item><item><title>Re: Problem in OnAfterChange code</title><link>https://www.infopathdev.com:443/forums/thread/14658.aspx</link><pubDate>Thu, 15 Jun 2006 06:30:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14658</guid><dc:creator>K.Ramana Reddy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14658.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14658</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;Did you test the above code.&lt;br /&gt;&lt;br /&gt;I added condition in the above code to not enter into infinite loop of Onafterchange event,&lt;br /&gt;&lt;br /&gt;if XDocument.DOM.selectSingleNode("/my:myFields/my:field1").text = " " then&lt;br /&gt;exit sub&lt;br /&gt;End if&lt;br /&gt;&lt;br /&gt;Thanks.</description></item><item><title>Re: Problem in OnAfterChange code</title><link>https://www.infopathdev.com:443/forums/thread/14657.aspx</link><pubDate>Thu, 15 Jun 2006 04:10:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14657</guid><dc:creator>liorlankri</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14657.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14657</wfw:commentRss><description>What is the  condition I need to add at the starting??</description></item><item><title>Re: Problem in OnAfterChange code</title><link>https://www.infopathdev.com:443/forums/thread/14656.aspx</link><pubDate>Wed, 14 Jun 2006 11:43:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14656</guid><dc:creator>liorlankri</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14656.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14656</wfw:commentRss><description>This is about one filed (the filed that I oparate OnAfterChange evevt). I other word I try to do action of OnBeforeChange event in a OnAfterChange event.&lt;br /&gt;In my code example "fiels2" is the same field as "eventObj"</description></item><item><title>Re: Problem in OnAfterChange code</title><link>https://www.infopathdev.com:443/forums/thread/14655.aspx</link><pubDate>Wed, 14 Jun 2006 10:25:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14655</guid><dc:creator>K.Ramana Reddy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14655.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14655</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;I have one question for you,&lt;br /&gt;&lt;br /&gt;Text entered field(good/bad) and target field(i.e, setti g value " " or text ) are  two different fields or one field.&lt;br /&gt;&lt;br /&gt;If it is one field, it will not work for you(it will go infinite loop, we have to add one condition at the starting),&lt;br /&gt;If they are two different fields, it is easy to do,&lt;br /&gt;&lt;br /&gt;Below code for one field, it is worked fine for me.&lt;br /&gt;&lt;br /&gt;Sub msoxd_my_field1_OnAfterChange(eventObj)&lt;br /&gt;&lt;br /&gt;if  XDocument.DOM.selectSingleNode("/my:myFields/my:field1").text = " " then&lt;br /&gt;	exit sub&lt;br /&gt;	End if&lt;br /&gt;	&lt;br /&gt;If eventObj.IsUndoRedo Then&lt;br /&gt;&lt;br /&gt;Exit Sub&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;if eventObj.Operation = "Delete" then&lt;br /&gt;exit Sub&lt;br /&gt;End if&lt;br /&gt;&lt;br /&gt;Dim Value&lt;br /&gt;Value=eventObj.NewValue&lt;br /&gt;&lt;br /&gt;if Len(Value)&amp;gt;0 then&lt;br /&gt;&lt;br /&gt;if Value&amp;lt;&amp;gt;"good" Then &lt;br /&gt;&lt;br /&gt; XDocument.DOM.selectSingleNode("/my:myFields/my:field1").text = " "&lt;br /&gt; end if &lt;br /&gt;end if&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Thanks</description></item><item><title>Re: Problem in OnAfterChange code</title><link>https://www.infopathdev.com:443/forums/thread/14654.aspx</link><pubDate>Wed, 14 Jun 2006 08:32:37 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14654</guid><dc:creator>liorlankri</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14654.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14654</wfw:commentRss><description>I try your Example and change it to this one:&lt;br /&gt;&lt;br /&gt;Sub msoxd_my_field1_OnAfterChange(eventObj)&lt;br /&gt;&lt;br /&gt;If eventObj.IsUndoRedo Then&lt;br /&gt;&lt;br /&gt;Exit Sub&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;if eventObj.Operation = "Delete" then&lt;br /&gt;exit Sub&lt;br /&gt;End if&lt;br /&gt;&lt;br /&gt;Dim Value&lt;br /&gt;Value=eventObj.NewValue&lt;br /&gt;&lt;br /&gt;if Len(Value)&amp;gt;0 then&lt;br /&gt;&lt;br /&gt;if Value&amp;lt;&amp;gt;"good" Then &lt;br /&gt;&lt;br /&gt;XDocument.DOM.selectSingleNode("/my:myFields/my:field2").text=""&lt;br /&gt;&lt;br /&gt;end if &lt;br /&gt;end if&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Now, I run the form an enter in the field "good". Since the IF condition not happen (because "good"="good") the value "good" stay in the field. Now I change the value to be "bad" ,Since the IF condition is happen (because "bad" &amp;lt;&amp;gt; "good")  the value "bad" in the field was replaced with "".&lt;br /&gt;&lt;br /&gt;Now (and here is the problem!!!!) I enter "test". the IF condition is happen (because "test" &amp;lt;&amp;gt; "good") BUT the value "test" was not replaced with ""!!!!!&lt;br /&gt;This is the problem!!!! why?</description></item><item><title>Re: Problem in OnAfterChange code</title><link>https://www.infopathdev.com:443/forums/thread/14653.aspx</link><pubDate>Wed, 14 Jun 2006 07:08:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14653</guid><dc:creator>K.Ramana Reddy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14653.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14653</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;I think, You have written function for returning true or false based on nodeValue, may be something wrong in it.&lt;br /&gt;&lt;br /&gt;I tried below code, it is working fine for me,&lt;br /&gt;&lt;br /&gt;Sub msoxd_my_field1_OnAfterChange(eventObj)&lt;br /&gt;&lt;br /&gt;If eventObj.IsUndoRedo Then&lt;br /&gt;&lt;br /&gt;	Exit Sub&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;if eventObj.Operation = "Delete" then&lt;br /&gt;exit Sub&lt;br /&gt;End if&lt;br /&gt;&lt;br /&gt;Dim Value&lt;br /&gt;Value=eventObj.NewValue&lt;br /&gt;&lt;br /&gt;if Len(Value)&amp;gt;0 then&lt;br /&gt;&lt;br /&gt;if Value="false1" Then &lt;br /&gt;&lt;br /&gt;XDocument.DOM.selectSingleNode("/my:myFields/my:field2").text=""&lt;br /&gt;&lt;br /&gt;end if &lt;br /&gt;end if&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Thanks.</description></item><item><title>Re: Problem in OnAfterChange code</title><link>https://www.infopathdev.com:443/forums/thread/14652.aspx</link><pubDate>Wed, 14 Jun 2006 05:03:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14652</guid><dc:creator>liorlankri</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14652.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14652</wfw:commentRss><description>This is my code:&lt;br /&gt;&lt;br /&gt;Sub msoxd_my_IdNumber_OnAfterChange(eventObj)&lt;br /&gt;&lt;br /&gt;if eventObj.IsUndoRedo then&lt;br /&gt;exit Sub&lt;br /&gt;End if&lt;br /&gt;			  		&lt;br /&gt;if eventObj.Operation = "Delete" then&lt;br /&gt;exit Sub&lt;br /&gt;End if&lt;br /&gt;&lt;br /&gt;Dim nodeValue&lt;br /&gt;nodeValue=eventObj.NewValue&lt;br /&gt;&lt;br /&gt;if Len(nodeValue)&amp;gt;0 then&lt;br /&gt;&lt;br /&gt;if IsIdInputOK(nodeValue)=false then&lt;br /&gt;XDocument.DOM.selectSingleNode("/my:myFields/my:A/my:IdNumber").text=""&lt;br /&gt;end if&lt;br /&gt;end if	&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;I will explain again:&lt;br /&gt;I enter input that make IsIdInputOK(nodeValue)=TRUE and after I enter Input that make IsIdInputOK(nodeValue)=FALSE so it's work and i get the value "" in the text field. But if I enter input that make IsIdInputOK(nodeValue)=FALSE and after I enter Input that make IsIdInputOK(nodeValue)=FALSE so it's not work and the wrong value stay on the text field and not change to ""</description></item><item><title>Re: Problem in OnAfterChange code</title><link>https://www.infopathdev.com:443/forums/thread/14651.aspx</link><pubDate>Tue, 13 Jun 2006 08:23:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14651</guid><dc:creator>K.Ramana Reddy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14651.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14651</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;Iam not getting what you are saying,&lt;br /&gt;Please provide your code, what you have written in  OnAfterChange Event. &lt;br /&gt;&lt;br /&gt;Thanks.</description></item><item><title>Re: Problem in OnAfterChange code</title><link>https://www.infopathdev.com:443/forums/thread/14650.aspx</link><pubDate>Tue, 13 Jun 2006 07:26:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14650</guid><dc:creator>liorlankri</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14650.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14650</wfw:commentRss><description>I try this but somthing strang happen.if I enter correct input (conditin=true) and after i enter not correct input (conditin=false) so the field get the blank value (""). BUT!!! if I enter not correct and after again not correct so the value not get change!!!&lt;br /&gt;&lt;br /&gt;what is the problem??</description></item><item><title>Re: Problem in OnAfterChange code</title><link>https://www.infopathdev.com:443/forums/thread/14649.aspx</link><pubDate>Mon, 12 Jun 2006 13:19:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14649</guid><dc:creator>K.Ramana Reddy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14649.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14649</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;write this code under OnAfterChange event.&lt;br /&gt;&lt;br /&gt;if(condition == false)&lt;br /&gt;{&lt;br /&gt;  IXMLDOMNode textNode = thisXDocument.DOM.selectSingleNode(Xpath);&lt;br /&gt;textNode.text = " ";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;this will work for you,&lt;br /&gt;&lt;br /&gt;Thanks.</description></item><item><title>Problem in OnAfterChange code</title><link>https://www.infopathdev.com:443/forums/thread/12895.aspx</link><pubDate>Mon, 12 Jun 2006 11:25:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12895</guid><dc:creator>liorlankri</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12895.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12895</wfw:commentRss><description>I have a OnAfterChange event for text field in my form.&lt;br /&gt;&lt;br /&gt;In this event I ask for sepecific condition (if....)&lt;br /&gt;I want  that in case that the "IF" is FALSE so that value of the field will be empty.&lt;br /&gt;how to do it?</description></item></channel></rss>