UpdateListItems

Nov 10, 2010 at 12:50 AM

Can you point me in the the right direction troubleshooting the error I keep recieving when I try to update list? Here is my code:

$().SPServices({
   operation: "UpdateListItems",
   listName: "F323700A-A647-439B-936C-A4DDA09D4BFE",
   batchCmd: "New",
   async:false,
   valuepairs: [["CaseID",csID ],["Case_x0020_Number",csNumber],["Title",csNumber],["Case_x0020_Status", scStatus],["Individuals_x0020_Name", scName]],
   completefunc:function(xData,Status){
    alert("Status: " + Status + " XData: " + xData.responseText);
    //alert('Case Status updated successfully');
   }
  });//End UpdateListItems

The error I keep getting is: The operation failed becasue of an unexpected error occurred.

Thank You

Marcus

Coordinator
Nov 10, 2010 at 1:24 AM

Marcus:

I don't see anything obviously wrong with your code. Where are you seeing the error? From the browser or in the returned XML? I think it's probably the former, and it may mean that your references to jQuery or SPServices aren't right.

M.

Nov 10, 2010 at 2:01 AM

Your correct. The returned xml is giving me this error. My problem is that from what I can see I referencing SPService and JQuery the same on this page as the others.

<script type="text/javascript">
if(typeof jQuery=='undefined'){
 var JQPath='/_layouts/jquery/jquery.min.js';
 document.write('<script src= "',JQPath,'" type="text/javascript"><\/script>');
}
</script>
<script type="text/javascript" language="javascript" src="/_layouts/jquery/jquery.SPServices.min.js"></script>

Coordinator
Nov 10, 2010 at 2:25 AM

I'm not sure I understand your reply because it seems like you're saying the error is in the returned XML. You wouldn't be getting that far unless both references were correct. If the error is in the XML, can you post the exact text?

M.

Nov 10, 2010 at 12:15 PM

Sorry for the cryptic response. The error message I recieve from the alert is as follows:

<Status: success XData:<?xml version=1.0 encoding="utf-8"?<soap:Envelope xmlns:soap=http://schemas.smlsoap.org/soap/envelope/ smlns:xsi=http://www.w3.org/2001/xmlSchema-instance xmlns:xsd=http://www.w3.org/2001/XMLSchema"><soap:Body><UpdateListItemsResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/"><UpdateListItemsResult><Results><Result ID="1", New"><ErrorCode>0x80020005</ErrorCode><ErrorText>The operation failed because an unexpected error occured.(Result Code: 0X80020005)</ErrorText></Result></Results></UpdateListItemsResult></UpdateListItemsResponse></soap:Body></soap:Envelope>

Coordinator
Nov 10, 2010 at 9:04 PM

That error code usually indicates that there's a type mismatch in the data you are trying to update. Try taking out each of the valuepairs one by one until you can figure out which one is causing the problem.

M.