Hi Experts,
We are upgrading a Infoapth form from MOSS 2007 to SharePoint 2010. Its a browser form with code behind.
On opening the form in Sharepoint 2010 there is one warning on loading of the form.
When we investigated the issue of warnings ULS logs gave following exception when we are setting few control values from code.
Ex:
XpathNavigator formVersion = xnDoc.SelectSingleNode(@"/my:myFields/my:field4", this.NamespaceManager);
formVersion.SetValue(this.Template.Version);
Just after .Setvalue is called an exception is logged in ULS as below,
"
Exception thrown from business logic event
listener: System.NullReferenceException: Object reference not set to an instance
of an object.
at
Microsoft.Office.InfoPath.Server.SolutionLifetime.XmlEventExternal.<>c__DisplayClass10.<add_Changed>b__c(Object
sender, XmlEventArgs e)
at
Microsoft.Office.InfoPath.Server.SolutionLifetime.XmlEventExternal.<>c__DisplayClass20.<FireChangedEvent>b__1c()
at
Microsoft.Office.InfoPath.Server.DocumentLifetime.OMExceptionManager.CallFormCodeWithExceptionHandling(UserMessages
userMessages, OMCall d)
"
Further investigation gave following infomation.
When the changed event is enabled at top fields level Ex: myFields
i.e
EventManager.XmlEvents[
/my:myFields"].Changed += new XmlChangedEventHandler(myFields_Changed);
then only above issue is occuring.
The form works without warnings in MOSS 2007. It only gives error in SharePoint 2010.
Can anyboy please help on above issue?
Thanks in advance
Prasad