Question

I have used webservices to Update Sharepoint list. I am using Network Credentials to access remort server.

mylist.Credentials = new NetworkCredential(_username, _password, _domain);

here is my innerXml code:

       StringBuilder innerXml = new StringBuilder();
              innerXml.AppendFormat("<Method ID='1' Cmd='Update'>" +
              "<Field Name='ID'>" + id + "</Field>" +
              "<Field Name='Title'>" + title + "</Field>" +
              "<Field Name='CostCTRShortText'>" + CostCTRShortText + "</Field>" +
              "<Field Name='ActTyp'>" + ActTyp + "</Field>" +
              "<Field Name='Employee'>" + Employee + "</Field>" +
              "<Field Name='Price'>" + Price + "</Field>" +
              "<Field Name='ITECCategory'>" + ITECCategory + "</Field>" +
              "<Field Name='ServicePrice'>" + ServicePrice + "</Field>"
              );

        innerXml.AppendLine("</Method>");

Unfortunatly I am geting an error when Update:

<Result ID="1,Update" xmlns="http://schemas.microsoft.com/sharepoint/soap/"><ErrorCode>0x81020016</ErrorCode><ErrorText>Item does not exist

The page you selected contains an item that does not exist.  It may have been deleted by another user.</ErrorText></Result>

This is only occur when Im trying to update List item in Remote server. Same code will work and update list item in Local site as expected.

Please help me.

Pas de solution correcte

Autres conseils

I have found the issue. Here ID is playing important roll. Make sure that your ID field retrieve the correct value. In my case ,My local list starts form ID =1 but production server list has not a row which ID=1 .

You can simply visible this ID column from your SharePoint list. And check the value.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top