Click here to Skip to main content
13,044,428 members (84,830 online)

SharePoint

 
QuestionAccessing SharePoint information regarding specific documents Pin
muneebalikiyani13-Feb-13 18:04
membermuneebalikiyani13-Feb-13 18:04 
AnswerRe: Accessing SharePoint information regarding specific documents Pin
ihoecken13-Feb-13 21:57
memberihoecken13-Feb-13 21:57 
QuestionPopulating list columns in Sharepoint 2010 custom doc library Pin
Aptiva Dave10-Feb-13 7:15
memberAptiva Dave10-Feb-13 7:15 
AnswerRe: Populating list columns in Sharepoint 2010 custom doc library Pin
AnandSharmaUK20-Feb-13 0:27
memberAnandSharmaUK20-Feb-13 0:27 
QuestionSoftware and Hardware requirements for document shareing Pin
HemadriT7-Feb-13 7:24
memberHemadriT7-Feb-13 7:24 
AnswerRe: Software and Hardware requirements for document shareing Pin
ihoecken10-Feb-13 21:10
memberihoecken10-Feb-13 21:10 
QuestionMessage Automatically Removed Pin
6-Feb-13 16:30
membera uj6-Feb-13 16:30 
QuestionDeleting Items in a SPListItemCollection Pin
Aptiva Dave31-Jan-13 5:05
memberAptiva Dave31-Jan-13 5:05 
Been having some trouble with doing this and have looked all over the internet for the actual solution. At first I was using a for each loop and deleting individual spitem objects, but that doesn't work since the enumeration changes after each deletion.

So, I found a blog post about deleting using the ProcessBatchData method. Here is my code:
Dim sbDelete As StringBuilder = New StringBuilder
                    Dim xmlFormat As String = "<?xml version=""1.0"" encoding=""UTF-8""?>"
                    sbDelete.Append(xmlFormat)
                    sbDelete.Append("<Batch>")
                    Dim buildQuery As String = "<Method><SetList Scope=""Request"">" & fList.ID.ToString & "</SetList>"
                    buildQuery = buildQuery & _
                        "<SetVar Name=""ID"">{0}</SetVar Name=""Cmd"">Delete</SetVar></Method>"
                    For Each x As SPListItem In flItems
                        sbDelete.Append(String.Format(buildQuery, x.ID.ToString()))
                    Next
                    sbDelete.Append("</Batch>")
                    web.ProcessBatchData(sbDelete.ToString)

This runs fine, but when I go to the list where the items where supposed to be deleted from I find that they are still there.

This web app is a fuel log for our Flight Operations department. What I'm trying to do is when the Admins delete a plane from the system, SharePoint would then deleted all of the fuel log entries for that plane. I figured it would be simple to do, but either I'm doing something wrong or it isn't as simple as I think.
AnswerRe: Deleting Items in a SPListItemCollection Pin
JimmyRopes7-Feb-13 1:39
memberJimmyRopes7-Feb-13 1:39 
QuestionGetting an error when trying to upload a document Pin
JimmyRopes30-Jan-13 2:35
memberJimmyRopes30-Jan-13 2:35 
AnswerRe: Getting an error when trying to upload a document Pin
ihoecken30-Jan-13 2:50
memberihoecken30-Jan-13 2:50 
GeneralRe: Getting an error when trying to upload a document Pin
JimmyRopes30-Jan-13 4:03
memberJimmyRopes30-Jan-13 4:03 
AnswerRe: Getting an error when trying to upload a document Pin
ihoecken30-Jan-13 4:55
memberihoecken30-Jan-13 4:55 
AnswerRe: Getting an error when trying to upload a document Pin
ihoecken30-Jan-13 2:57
memberihoecken30-Jan-13 2:57 
GeneralRe: Getting an error when trying to upload a document Pin
JimmyRopes30-Jan-13 4:05
memberJimmyRopes30-Jan-13 4:05 
QuestionRequest for Sharepoint tutorial links Pin
obalesu28-Jan-13 18:18
memberobalesu28-Jan-13 18:18 
AnswerRe: Request for Sharepoint tutorial links Pin
ihoecken28-Jan-13 21:13
memberihoecken28-Jan-13 21:13 
QuestionCan CAML query handle multiple lists? Pin
Clark Kent12328-Jan-13 5:35
memberClark Kent12328-Jan-13 5:35 
AnswerRe: Can CAML query handle multiple lists? Pin
ihoecken28-Jan-13 21:17
memberihoecken28-Jan-13 21:17 
GeneralRe: Can CAML query handle multiple lists? Pin
Clark Kent12329-Jan-13 1:34
memberClark Kent12329-Jan-13 1:34 
QuestionThrowing an exception when trying to attach a document to a list item Pin
JimmyRopes25-Jan-13 2:34
memberJimmyRopes25-Jan-13 2:34 
AnswerRe: Throwing an exception when trying to attach a document to a list item Pin
Aptiva Dave31-Jan-13 5:07
memberAptiva Dave31-Jan-13 5:07 
GeneralRe: Throwing an exception when trying to attach a document to a list item Pin
JimmyRopes31-Jan-13 13:30
memberJimmyRopes31-Jan-13 13:30 
GeneralRe: Throwing an exception when trying to attach a document to a list item Pin
JimmyRopes7-Feb-13 2:31
memberJimmyRopes7-Feb-13 2:31 
QuestionHo to Enable Titlle Column in Document Library using power shell in sharepoint 2010 Pin
ps4124-Jan-13 18:21
memberps4124-Jan-13 18:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 26 Jun 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid