Solved

Mail in what folders(s)?

Posted on 2003-11-17
10
496 Views
Last Modified: 2013-12-18
Hi

How can I add a column that shows what folders the different mails are stored in?

I'm using Notes 4.6.7
0
Comment
Question by:klunde
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
10 Comments
 
LVL 31

Expert Comment

by:qwaletee
ID: 9764181
First, you need to enable IMAP-compatible folder handling.  To do this, run the server CONVERT command with the -m paraneter against the mailbox, e.g., LOAD CONVERT -M mail\klunde.nsf

0
 
LVL 2

Expert Comment

by:ksi2001
ID: 9764193
Interesting task. But you cannot do it in a column formula. The only way is to write this information into the document, which is probably could be done at postdragdrop event of the database, and in every part of code where you are moving documents to folders.
0
 
LVL 2

Expert Comment

by:ksi2001
ID: 9764263
Or and there is an event QueryAddToFolder  for the views and folders which is exactly what you need.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 31

Expert Comment

by:qwaletee
ID: 9764332
But that only soves half your problem; the other half is even more diificult.

When IMAP references are enabled, the following additional features are available for each document:

1) When accessed via NotesDocument (or lotus.notes.Document), there is a property called FolderReferences.  This property is an array of strings.  The strings are folder names.  But there is no equivalent @Function or field

2) There are three special fields on teh document $Folder, $FolderRef, and $FolderRefFlags.  $FolderRef is the source of information for FolderReferences.  But, while FolderReferences contains view names, $FolderRef does not. Instead, it is a text list of folder UniversalID strings, the 32-hex-digit internal key of a folder's design record. FolderReferences is "nice enough" to look up taht information for you.

3) Two special views are added.  One, ($FolderRefInfo), is all the document categorized on $FolderRef.  the other view shows a list of all folders, with two columns.  the first column is the folder's UNID, the second column is teh folder's name.  the first column is sorted.
0
 
LVL 2

Expert Comment

by:ksi2001
ID: 9764406
qwaletee: in order to use these properties klunde should upgrade to R5

0
 
LVL 31

Accepted Solution

by:
qwaletee earned 50 total points
ID: 9764412
Now, how do you put it all together?  The view column can't make use of FolderReferences, because it is a property of the object model, while columns onlyhave fields and @functions.  The only field it has is $FolderRefs, and that would work, except I'm sure showing the folder UNID instead of its name is unacceptable.

So, what can you do?  There are two ways to handle it.

1) Don't show a column.  Instead, add a view action taht when clicked displasy teh highlighted document's folders.  the following code wuld do the trick:
Dim s as new notesSession
If Not s.currentdatabase.folderreferencesEnabled Then
  Msgbox "This database does need CONVERT -M before this feature will work"
  End
End If
Dim folderList as string
Forall foldername in s.DocumentContext.folderReferences
  folderList = folderList & Chr$(13) & folderName
End Forall
If folderList = "" Then
  MsgBox "No folders for this document"
Else
  Msgbox "Folders:" & folderList
End If

2) You can run code on your documents that will add a field to the document conatining the folder name. the code is fairly simple -- similar to teh code above.  But...
a) it would have to be run as an agent against all existing documents
b) it would have to run against all messages when they arrive
c) you would have to add it in to all the Move to folder objects and Add to folder events
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9764417
No, they are available in 4.6 as well.
0
 

Author Comment

by:klunde
ID: 9769584
This looks very promesing!

But a slight problem. My Notes states that .folderreferencesEnabled is not a member of this class.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9773477
Hmm... folder references might have been added to the object model in 5, I'll have to check.  But the $Folder field hs been there since 4.5 or 4.6 for sure.  You can see this if you have it enabled for your malbox.

Here is sample code that would be the equivalent if you cold not use folder references in the object model...

**** Instead of:

Forall foldername in s.DocumentContext.folderReferences
  folderList = folderList & Chr$(13) & folderName
End Forall


**** Use:

Dim folderNames List as string, folderName as string, folder as notesDocument
Forall folderID in s.DocumentContext.~$FolderRef
  If IsElement(folderNames(folderID)) Then
    foldername = folderNames(folderID)
  Else
    set folder s.currentDatabase.getDocumentByUNID(folderID)
    foldername = folder.~$Title(0)
    foldernames(folderID) = folderName
  End If
  folderList = folderList & Chr$(13) & folderName
End Forall
0
 

Author Comment

by:klunde
ID: 9777002
This works!
Great! Thanks!

(after changing to "set folder = s.curr.....")
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question