Click here to Skip to main content
12,502,578 members (54,307 online)

SharePoint

 
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 

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
Web02 | 2.8.160919.1 | Last Updated 17 Sep 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid