Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Messages not storing in folders (and vanishing messages) 1

Status
Not open for further replies.

cmv131

MIS
Feb 16, 2005
158
US
Hi all,

Another interesting issue. We have a user whos mail does not stay in the folders it is dropped into.

When she drags a message into a folder, it dissapears from the inbox and does not appear in the folder. It can only be found in all documents. She also appears to have lost years worth of messages out of these folders. The messages just vanished into all documents.

The folders appear OK in designer and what I see in designer matches what is in the mailfile. Any idea why user wouldn't be able to drop messages into these folders, and why years worth of messages in them just dissappeared?

And more importantly, is there anyway to run an Agent or something to relocate the messages? (User will be very upset if she has to sort through 50,000 messages)
 
Hi cmv313,

The only suiggestion I can make is that's there possibly another replica out there somewhere causing this; however, in cases where the design has looked ok, I have found that deleting the system folders & views, and then replacing the design, has worked.

The code in this agent loops through the "All Documents" views & places any docs it finds (that are not in a folder) into the specified folder. It might be that you could expand this to prompt for a folder name for each mail, but that might take a long time for the user to get through!

code

Sub Click(Source As Button)

Dim s As New notessession
Dim db As notesdatabase
Dim fDoc As NotesDocument ' Document in folder
Dim ad As notesview ' All Documents view
Dim aDoc As notesdocument ' document in All Docs view
Dim fUNID() As String ' array of UNID's of docs in folders
Dim i As Integer ' UNID array index
Dim deldate As notesitem
Dim Chair1 As notesitem

strFolder = Inputbox("Please enter folder")
If strFolder = "" Then Exit Sub

i =0
Set db = s.CurrentDatabase

' Build UNID array by looping through folders, then their documents
Forall view In db.views
If view.IsFolder And Not view.Name=("($All)") Then
Set fDoc = view.GetFirstDocument
While Not fDoc Is Nothing
Redim Preserve fUNID(i)
fUNID(i) = fDoc.UniversalID
i=i+1
Set fDoc = view.GetNextDocument(fDoc)
Wend
End If
End Forall

' Loop through docs in the All Documents view and compare UNIDs to each doc in the array
Set ad = db.GetView("($All)")
Set aDoc = ad.GetFirstDocument
While Not aDoc Is Nothing
i = 0
Do While i <= Ubound(fUNID)
If fUNID(i) = aDoc.UniversalID Then
Exit Do
End If
i = i + 1
Loop
Set deldate = adoc.getfirstitem("delivereddate")
Set Chair1 = adoc.getfirstitem("CHAIR")
If i > Ubound(fUNID) And Not deldate Is Nothing And Chair1 Is Nothing Then
Call adoc.PutInFolder( strFolder)

End If
Set aDoc = ad.GetNextDocument(adoc)
Wend
End Sub

/code
 
Very cool. I have made note of that code and stored it away for future use. It turned out that the problem was caused by a few corrupt folders, and re-upgraded the folder design and the messages re-appeared.

Very interesting...

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top