How to delete items via ProcessBatchData and CAML query?


  • I need a way to delete several thousand items from a list. All these items match to the following CAML query:

    ><Where>  <And>    <Neq>      <FieldRef Name="ContentType" />      <Value Type="Text">Договор</Value>    </Neq>    <Eq>      <FieldRef Name="Status" />      <Value Type="Text">Завершенные</Value>    </Eq>  </And></Where

    My initial idea was to do it exactly according to this topic, but I have an additional requirement of not using of explicit IDs in the generated query. Moreover, I'd like to avoid retrieving all these items before deletion at all. As far as I understand there's a way to combine ProcessBatchData() and CAML query to accomplish this task. How can I do this?

    • Edited by Senglory Monday, June 18, 2012 11:56 AM added CAML
    Monday, June 18, 2012 11:48 AM


All replies