Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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>
  </Method>
</Batch>

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>
    </Method>
</Batch>

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="http://schemas.microsoft.com/sharepoint/soap/">
    <Result ID="1,Update">
       <ErrorCode>0x80070005</ErrorCode>
       <ErrorText>The operation failed because an unexpected error occurred. (Result Code: 0x80070005)</ErrorText>
    </Result>
</Results>

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

Nigel

share|improve this question
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.