<?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: Changed Event on group fields throwing exception.</title><link>https://www.infopathdev.com:443/forums/thread/88106.aspx</link><pubDate>Mon, 18 Mar 2013 11:29:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:88106</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/88106.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=88106</wfw:commentRss><description>&lt;p&gt;Where is this code located:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;EventManager.XmlEvents[&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/my:myFields&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;].Changed += &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XmlChangedEventHandler&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(myFields_Changed);&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Is it in the place where InfoPath automatically creates lines like this, or have you put it somewhere else?&amp;nbsp; Could you show us the full content of your myFields_Changed event handler? Perhaps there is another way to accomplish what you are doing.&lt;/p&gt;</description></item><item><title>Changed Event on group fields throwing exception.</title><link>https://www.infopathdev.com:443/forums/thread/88010.aspx</link><pubDate>Thu, 14 Mar 2013 11:29:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:88010</guid><dc:creator>Prasad Joshi</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/88010.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=88010</wfw:commentRss><description>&lt;p&gt;Hi Experts,&lt;/p&gt;&lt;p&gt;We are upgrading a Infoapth form from MOSS 2007 to SharePoint 2010. Its a browser form with code behind.&lt;/p&gt;&lt;p&gt;On opening the form in Sharepoint 2010 there is one warning on loading of the form.&lt;/p&gt;&lt;p&gt;When we investigated the issue of warnings ULS logs gave following exception when we are setting few control values from code.&lt;/p&gt;&lt;p&gt;Ex: &lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;XpathNavigator formVersion = xnDoc.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;@&amp;quot;/my:myFields/my:field4&amp;quot;&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;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.NamespaceManager);&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;
&lt;/font&gt;&lt;font size="2"&gt;formVersion.SetValue(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Template.Version);&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;p&gt;Just after .Setvalue is called an exception is logged in ULS as below,&lt;/p&gt;&lt;p&gt;&lt;font size="3" face="Times New Roman"&gt;

&amp;quot;&lt;/font&gt;&lt;/p&gt;&lt;p style="margin:0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="background:navy;color:white;font-size:8.5pt;mso-highlight:navy;"&gt;Exception&lt;/span&gt;&lt;span style="font-size:8.5pt;"&gt; thrown from business logic event
listener: System.NullReference&lt;span style="background:navy;color:white;mso-highlight:navy;"&gt;Exception&lt;/span&gt;: Object reference not set to an instance
of an object.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="3" face="Times New Roman"&gt;

&lt;/font&gt;&lt;span style="font-size:8.5pt;"&gt;&amp;nbsp;at
Microsoft.Office.InfoPath.Server.SolutionLifetime.XmlEventExternal.&amp;lt;&amp;gt;c__DisplayClass10.&amp;lt;add_Changed&amp;gt;b__c(Object
sender, XmlEventArgs e)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="3" face="Times New Roman"&gt;

&lt;/font&gt;&lt;span style="font-size:8.5pt;"&gt;&amp;nbsp;at
Microsoft.Office.InfoPath.Server.SolutionLifetime.XmlEventExternal.&amp;lt;&amp;gt;c__DisplayClass20.&amp;lt;FireChangedEvent&amp;gt;b__1c()&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="3" face="Times New Roman"&gt;

&lt;/font&gt;&lt;span style="font-size:8.5pt;"&gt;&amp;nbsp;at
Microsoft.Office.InfoPath.Server.DocumentLifetime.OM&lt;span style="background:navy;color:white;mso-highlight:navy;"&gt;Exception&lt;/span&gt;Manager.CallFormCodeWith&lt;span style="background:navy;color:white;mso-highlight:navy;"&gt;Exception&lt;/span&gt;Handling(UserMessages
userMessages, OMCall d)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="3" face="Times New Roman"&gt;

&amp;quot;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;Further investigation gave following infomation.&lt;/p&gt;&lt;p&gt;When the changed event is enabled at top fields level Ex: myFields&lt;/p&gt;&lt;p&gt;i.e &lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;p&gt; EventManager.XmlEvents[&lt;/p&gt;&lt;/font&gt;&lt;p&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;/my:myFields&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;].Changed += &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XmlChangedEventHandler&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(myFields_Changed);&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;p&gt;&lt;font size="3" face="Times New Roman"&gt;then only above issue is occuring.&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="3" face="Times New Roman"&gt;The form works without warnings in MOSS 2007. It only gives error in SharePoint 2010. &lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="3" face="Times New Roman"&gt;Can anyboy please help on above issue?&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="3" face="Times New Roman"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;font size="3" face="Times New Roman"&gt;Thanks in advance&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="3" face="Times New Roman"&gt;Prasad&lt;/font&gt;&lt;/p&gt;</description></item></channel></rss>