none
Object reference not set to an instance of an object RRS feed

  • Question

  • Hello Great Forum of wisdom, I bow before your patient mercy...

      I have created the forms with Full Trust and my digital signature and uploaded them to SharePoint 2007.  Forms  

    Object reference not set to an instance of an object.

       at Security_Tracer.FormCode.CTRL8_8_Clicked(Object sender, ClickedEventArgs e)

       at Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)

       at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)

    Tuesday, April 17, 2012 6:51 PM

Answers

  • Hi super8ieff,

    According to your description, you’ve created a InfoPath form and uploaded them to the SharePoint 2007. When using the form, an Object reference not set to an instance of an object Exception is thrown.

    In your case, I checked your code behind of the button, please check the XPath "/dfs:myFields/dfs:dataFields/SOLDIER_DATA/@NAME_" , if this XPath is wrong, the variable nameNode will be equal to null, An Object reference not set to an instance of an object Exception will be thrown when the clause nameNode.Value is evaluated.

    If you are using browse enabled infopath form, it’s not very easy to debug the code behind. You can debug it by following steps:

    1. Build the InfoPath Form Template with Debug Info
    2. Deploy it to the farm
    3. Attach to the server by using the Remote Debugging.

    Please check this Document for more information about debugging Browser-Enabled form.

    Thanks,


    Lambda Zhao

    TechNet Community Support

    • Marked as answer by Pengyu Zhao Monday, April 30, 2012 1:33 AM
    Wednesday, April 18, 2012 8:50 AM

All replies

  • The code behind the button is: Dim filename As String
                 Dim nameNode As XPathNavigator
                 nameNode = MainDataSource.CreateNavigator.SelectSingleNode("/dfs:myFields/dfs:dataFields/SOLDIER_DATA/@NAME_", NamespaceManager)
                 Dim timestamp As String
                 Dim tsNode As XPathNavigator
                 tsNode = MainDataSource.CreateNavigator.SelectSingleNode("/my:myFields/my:timestamp", NamespaceManager)
                 filename = nameNode.Value + tsNode.Value + ".pdf"
                 CurrentView.Export("
    http://sharepoint/sites/Personnel/Automated%20Programs/Memos/backbone/NGOA/Forms/AllItems.aspx_" + filename, ExportFormat.Pdf)

    I really appreciate your direction.

       Respectfully,

                  Jeff

    Tuesday, April 17, 2012 7:18 PM
  • Hi super8ieff,

    According to your description, you’ve created a InfoPath form and uploaded them to the SharePoint 2007. When using the form, an Object reference not set to an instance of an object Exception is thrown.

    In your case, I checked your code behind of the button, please check the XPath "/dfs:myFields/dfs:dataFields/SOLDIER_DATA/@NAME_" , if this XPath is wrong, the variable nameNode will be equal to null, An Object reference not set to an instance of an object Exception will be thrown when the clause nameNode.Value is evaluated.

    If you are using browse enabled infopath form, it’s not very easy to debug the code behind. You can debug it by following steps:

    1. Build the InfoPath Form Template with Debug Info
    2. Deploy it to the farm
    3. Attach to the server by using the Remote Debugging.

    Please check this Document for more information about debugging Browser-Enabled form.

    Thanks,


    Lambda Zhao

    TechNet Community Support

    • Marked as answer by Pengyu Zhao Monday, April 30, 2012 1:33 AM
    Wednesday, April 18, 2012 8:50 AM