OpenNTF.org - GMail labels for Lotus Notes m
My Links (Not logged in)
Code Bin Search
 
Hosted by Prominic.NET
Rate This Code
5 - brilliant stuff
4 - very nice
3 - average
2 - needs work
1 - bad
   OpenNTF Code Bin
About This Code
Brief Description:
GMail labels for Lotus Notes mail 
Rating:
Rating: 3.66666666666667 , Number of votes: 3 
Contributor:
Klaus Terman 
Category:
Design Elements 
Type:
Email 
Document Release:
0.1 
Notes Version:
R6.x 
Last Modified:
24 Apr 2006 
OpenNTF Disclaimer

All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.

Code / Description
I created 3 actions and 1 view to mimic the label functionality of GMail (Google Mail) in my Lotus Notes R 6 mail. I havn't tested in any other releases.


I use the actions from my inbox to add labels to the mails and then to archive the mails (that is remove the mails from my inbox folder). After that I can find the mails in my view called "Documents by label" which is a categorised view that shows all my labels.

Alternatively I can do advanced searches like "field gLabel contains Klaus Terman"

I have attached an empty database with the 3 actions and the view that I use. You should be able to copy/paste all designelement into either your mailtemplate or your mailfile. The actions are shared actions.

Action1 : Label (Adds or removes the chosen label)

availableLabels := @Trim(@Unique(@DbColumn("":"NoCache"; ""; "gLabels"; 1): "- New label -"));
chosenLabel := @Prompt([OkCancelCombo]; "Labels"; "Choose the label you want to add or remove"; ""; availableLabels);
action := @If(chosenLabel = "- New label -"; "new";
@IsMember(chosenLabel; gLabels); "remove";
"append");

@If(
action = "remove";
@Do(
@SetField("gLabels"; @Trim(@Replace(gLabels; chosenLabel; " ")));
@If(gLabels = ""; @SetField("gLabels"; @DeleteField); gLabels)
);

action = "append";
@SetField("gLabels"; @Trim(gLabels:chosenLabel));

action = "new";
@SetField("gLabels"; @Trim(gLabels:@Prompt([OkCancelEdit]; "New label"; "Write the name of the new label"; "")));

@Success
)

Action2 : Remove all labels
FIELD gLabels := @DeleteField;

Action3 : Archive
Simple action => Remove document from folder 'Inbox'

PS. The view is based on a danish inbox folder. The only thing I did was create a categorised label column and put it in front of the standard columns. I removed the alternative sortings on the inbox columns as well.

Usage / Example
Code Attachments
labels.nsf (512 Kbytes)
 Comments
Posted by David Phillips on 04/25/2006 04:33:29 PMTag & move
Thanks much for sharing, Klaus, and I appreciated the email notice. Since changing to this approach I've found it enormously helpful. It's much more productive for me than maintaining folders.
I've done something similar to what you describe, using the built-in Categorize action, and adding a "by Category" view. I added a "Tag & move" action to my Inbox folder defined as:
REM { Move all selected documents to another folder, change to that folder, reselect all, categorize them, reselect all, remove from folder, return to Inbox. This gets around the problem that Categorize automatically deselects all. };
FIELD DeliveredDate := @If (DeliveredDate != ""; DeliveredDate; PostedDate); "Mark unSent for use in Sent mail folder.";
@PostedCommand ([FolderDocuments]; "tmpForCategorize"; "1");
@PostedCommand ([ViewChange]; "tmpForCategorize");
@PostedCommand ([EditSelectAll]);
@PostedCommand ([ToolsCategorize]);
@PostedCommand ([EditSelectAll]);
@PostedCommand ([ToolsMarkSelectedRead]);
@PostedCommand ([EditSelectAll]);
@PostedCommand ([RemoveFromFolder]);
@PostedCommand ([ViewChange]; "($Inbox)")
--David
 Add your comment!