SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a .NET solution which uses the SharePoint web services interface to update meta data for existing documents in a SharePoint library. However, I am finding that I need to supply different CAML update commands for my development system compared to our test environment (both environments contain several hundred test documents).

In my development environment I can use a CAML statement of the form:

<Batch OnError="Continue" PreCalc="TRUE">
  <Method ID="1" Cmd="Update">
     <Field Name="ID"></Field>
     <Field Name="FileRef">http://SPDevServer/sites/GovTrng/OTA/Dev Tax Returns/H000111/Test Doc.docx</Field>
     <Field Name="Tax_x0020_Reference">C12346</Field>

However, in my test environment I have to use a CAML statement of the form:

<Batch OnError="Continue" PreCalc="TRUE">
  <Method ID="1" Cmd="Update">
     <Field Name="ID">1234</Field>
     <Field Name="FileRef">http://SPTestServer/sites/GovTrng/OTA/Test Doc.docx</Field>
     <Field Name="Tax_x0020_Reference">C12346</Field>

i.e. I need to supply the SharePoint document ID in the CAML update command. If I don't supply the ID I get the error shown below:

<Results xmlns="">
    <Result ID="1,Update">
       <ErrorText>The operation failed because an unexpected error occurred. (Result Code: 0x80070005)</ErrorText>

Why the difference and how can I tell in what circumstance I need to supply the document ID?

I know I could probably get away with always supplying the ID but this involves an extra call to SharePoint which ideally I want to avoid.

Many thanks


share|improve this question

I think this must be something to do with the Document ID Service state on the two different environments. Is it Active on the Test site collection, but not Dev?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.