If your Inbox is anything like mine, then it's quite a mess. Other than the standard column icons that comes built with Notes, there really is no way of quickly knowing what type of email you are receiving in regards to groups, carbon-copies, or blind-copies (even Return Receipts!). Also, in R4, there is no way to know if you have replied to a memo (if you use the read/unread marks, then this doesn't apply to you). In this tip, I will show how you can programmatically using column icons to mark memos that you have replied and to better define what type of memos you are receiving.
1. You will need to add design elements to the "Reply" and "Reply with History" forms of your mail template. First, make sure that these forms inherit values from their parent documents. In these forms, I added a "computed when composed" number field named "InDocID" and made it hidden. The default value of this field has this code:
@Text(@InheritedDocumentUniqueID) - Thats right, you are grabbing the DocID of the memo you are replying to.
I also added a number field and called it "RepliedTo" and set it's default value to "0". This field is used to acquire the icon that represents if you have replied to a memo.
2. In the Send button of the form, add the following code:
This code will set your RepliedTo field to "82" which is a checkmark signifying that you have replied to the parent document. Since, InDocID is a "computed when composed" field, the send button will set that field whether you are working from your Inbox or Drafts view.
**Problem: When you have replied to a memo, the parent memo now becomes an "unread" memo because the document has a field that was updated in which now makes it unread. How can you keep it read? Here's how:
In the Sandbox on IBM Lotus' Developer's site, there is a script library written by Daniel Avers entitled, "NotesUnreadMarks class". (http://www-10.lotus.com/ldd/sandbox.nsf/ecc552f1ab6e46e4852568a90055c4cd/50c04aabe223bdcb8525688d007060c7?OpenDocument) This script library gives you the ability to manipulate read/unread marks for documents in notes databases. Very cool! To have this library work for this tip, you have to use an agent that calls this script. Daniel gives you a sample agent to work with. All I did was add this line of code:
Set parent = db.GetDocumentByUNID( doc.GetItemValue( "$Ref" )( 0 ) )
3. And in the Send button, I added this code under the @SetDocField formula: @Command([ToolsRunMacro];"(MarkRead)") --I am calling the agent "(MarkRead)" after I set the "RepliedTo" field. So now I am setting the field for the checkmark icon and marking the parent document (memo) read!
4. Now to display the icon, you can add a new column in the ($Inbox) folder or just use the same column where the standard icons are displayed and append this code. Also, this code displays specific icons if your name appears in the CC field, BCC field, part of a group, or if someone is requesting a Return Reciept (Ha!):
icon := @If(@Contains(SendTo;"Group");4;@Contains(CopyTo;name);34;@Contains(BlindCopyTo;name);57;ReturnReceipt="1";166;[standard icons code here, use a temp var]); @If(RepliedTo="82";82;icon)
To summarize, you have successfully marked documents that you have replied to and marked the parent documents "read". In addition, you are using column icons to display your icons and also define whether your name appears in the CC, BCC, Groups, or if someone has requested a return receipt.
CREDITS: Thanks to Daniel Avers for submitting his script library to the Developers Forum. This tip is also in response to a Developer Forum post: "Tricky mail view problem - mark as being replied to?".