Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Need to move forms to an archive lbrary

  Asked By: Carmen    Date: Jun 14    Category: Sharepoint    Views: 2251

We have a SPPS 2003 Work Request site that uses an InfoPath form for service
requests and an Event Handler generates a Work Order on a customized Issue List.
The problem is that we exceed the 2000 item threshold and have to archive items.
I copy old items from the list to an Excel spreadsheet and save it in another
library. Then I have an application that deletes items prior to a date specified
on the web form. To archive the InfoPath forms I have been opening the
production library and the destination archive library both in Explorer View and
manually cut and paste the selected forms from production to archive.

I tried writing an appliction to move the forms based on the example of Moving
files in the wsssdk using:
Dim files As SPFileCollection = web.GetFolder("Requests").Files
Dim destFold As SPFolder = site.GetFolder("RequestsArch3")
site.AllowUnsafeUpdates = True

For i = files.Count - 1 To 0 Step -1
If InStr(files(i).Name, strStartDate) > 0 Then
files(i).MoveTo(destFold.ToString & files(i).Name, True)
End If
Next i

I get "The security validation for this page is invalid.....' error. I am using
impersonation and site.AllowUnsafeUpdates=True

Any ideas??



4 Answers Found

Answer #1    Answered By: Bobbie Rodgers     Answered On: Jun 14

Try adding



site.AllowUnsafeUpdates = True

Answer #2    Answered By: Bhumi Gokhale     Answered On: Jun 14

web.AllowUnsafeUpdates = True on the destination web.

You should not need site.AllowUnsafeUpdates = True or an Update()

another approach is to put the forms  in folders in the same list. I
have used an event handler on item added with great success.

Answer #3    Answered By: Davon Henson     Answered On: Jun 14

I turned on trace and the error is occurring on th
efiles(i).MoteTo... line. I even tried creating a folder in the same library and
still get get the security error.

Answer #4    Answered By: Aakash Gavade     Answered On: Jun 14

'web.AllowUnsafeUpdates = True' did the trick.

Didn't find what you were looking for? Find more on Need to move forms to an archive lbrary Or get search suggestion and latest updates.