The following error occurred:Server was unable to process request. ---> Object reference not set to an instance of an object. - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

The following error occurred:Server was unable to process request. ---> Object reference not set to an instance of an object.

Last post 12-06-2008 10:10 AM by Jimmy. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 12-04-2008 08:39 AM

    The following error occurred:Server was unable to process request. ---> Object reference not set to an instance of an object.

    I get the following error when I try to add a record to a Sharepoint List. 

    The SOAP response indicates that an error occurred on the server:

    Server was unable to process request. ---> Object reference not set to an instance of an object.

    File:script.js
    Line:120

    Line 120 is XDocument.DataAdapters["Submit"].Submit();

    Does anyone know why?  I am submitting to the UpdateListItem web service.

    Code:

    function btnAdd::OnClick(eventObj)
    {
     var root = XDocument.DOM;

     // Retrieve the values for the calendar item
     var title = root.selectSingleNode("my:myFields/my:myFields1/my:Title").text;
     var location = root.selectSingleNode("my:myFields/my:myFields1/my:Location").text;
     var description = root.selectSingleNode("my:myFields/my:myFields1/my:Description").text;

     var batch = XDocument.DataObjects["EventCAML"].DOM;

     // Set the location
     batch.selectSingleNode("/Batch/Method/Field[@Name='Title']").text = title;

     // Set the location
     batch.selectSingleNode("/Batch/Method/Field[@Name='Location']").text = location;

     // Set the location
     batch.selectSingleNode("/Batch/Method/Field[@Name='Description']").text = description;

        // Submit the item details to the web service to update the calendar 
     XDocument.DataAdapters["Submit"].Submit();
     XDocument.UI.Alert( "Change Request has been successfully saved" );  
    }

     

    Filed under: ,
  • 12-04-2008 07:16 PM In reply to

    Re: The following error occurred:Server was unable to process request. ---> Object reference not set to an instance of an object.

    Hi Steve,

    Is your data connection named "Submit"? That's probably the issue. It has to have the same name.

    Patrick Halstead
    Project Manager at Qdabra
  • 12-05-2008 04:43 AM In reply to

    Re: The following error occurred:Server was unable to process request. ---> Object reference not set to an instance of an object.

    Yes it does.  It is named "Submit"

    Filed under: ,
  • 12-06-2008 08:50 AM In reply to

    Re: The following error occurred:Server was unable to process request. ---> Object reference not set to an instance of an object.

    I made the following corrections but I still get the same error.  I deleted he Location column and re-added it so the right name is used.  I was testing with using Rules for the submit option is why there were two sets of Submits.   

    The following error occurred:

    InfoPath cannot submit the form.
    An error occurred while the form was being submitted.
    The SOAP response indicates that an error occurred on the server:

    Server was unable to process request. ---> Object reference not set to an instance of an object.

    File:script.js
    Line:43

    Attached, please find an update which uses C# Managed Code (for IP2003) to do the task.

    There were some problems with the form and code:

    1. The Add button performed a submit and requery, followed by the code performing a submit.

    a. Removed the submit/query rules and added query functionality to code.

    2. The EventCAML.xml file had a wrong field name listed, causing the submit error:

    <Field Name="Location"></Field>

    Should have been:

    <Field Name="Change_x0020_Request_x0020_Title"></Field>

    Filed under: ,
  • 12-06-2008 10:10 AM In reply to

    Re: The following error occurred:Server was unable to process request. ---> Object reference not set to an instance of an object.

    That error is occurring on the SharePoint server itself, and a likely cause is that you are not specifying a listName as a parameter to the WebMethod.  If you are specifying a listName, what is the value you are using?  It should be a GUID.

     See also:
    Get a SharePoint list GUID from the browser
    Add SharePoint list items with InfoPath

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.