Tip

Convert To Misc Activity

Does your company require that you log everything in Notes? My company does.
I find it tedious to follow up with logging of entries that originate via
Email. Emails that contain design decisions, project approvals, etc. must all
be logged for our customers. I wrote an agent which allows our users to select
one or more documents (related to a specific customer) from their mail file and
convert it into a basic rich text response document (that we call a
miscellaneous activity) to that customer's profile in our customer tracking
database. It supports remote users that are using local database replicas as
well. With a click of a button, important Emails are logged!
It is comprised of two parts: a formula-based agent which may be added to the
mail file actions menu/button bar(s) and a LotusScript agent that is invoked
from the first agent.

The formula-based agent provides a list of available customers (profiles) from
the target database into which the misc document(s) will be stored. Once the
customer is selected, a new document (misc activity) will be created as a
response to that customer's profile for each selected Email.

custList := @DbColumn("": "NoCache"; "852560DE:006C7C79" ;"(CustSort)";1);
@SetEnvironment("Customer"; @Prompt([OKCANCELLIST];"Customer Profiles";"Choose
the customer for which ALL selected memos will be converted to Misc
Activities. Press Cancel if the selected memos are not associated with the
SAME customer profile."; ""; custList));
@Command([ToolsRunMacro];"(CustTrackingEntry)");

The LotusScript agent is invoked after the appropriate customer is selected.
The new document identifies the author and recipients of the Email, the
subject, and date. The body of the Email (attachments, doclinks, etc.) is
copied into the body of the new document and the document is saved in the
customer database. If run locally, an alert is displayed to remind the user to
replicate the target database.

'CustTrackingEntry:

'CustTrackingEntry:

Option Public
Option Declare


Sub Initialize

Dim s As New NotesSession
Dim curDB As NotesDatabase
Dim db As New NotesDatabase("", "")
Dim view As NotesView
Dim customerProfile As NotesDocument
Dim mailFile As NotesDatabase
Dim memos As NotesDocumentCollection
Dim memo As NotesDocument
Dim miscActivity As NotesDocument
Dim rtitem As NotesRichTextItem
Dim memoBody As Variant ' NotesRichTextItem
Dim docAuthor As NotesName
Dim recipient As NotesName
Dim recipientName As NotesName
Dim companyName As String
Dim n As Integer
Dim count As Integer
Dim server As String
Dim serverName As String
Dim recipientList As String
Dim listLength As Integer
Dim resp%

companyName = s.GetEnvironmentString("Customer")
If companyName = "" Then
Messagebox "You must select a customer profile under which to create
the new Misc Activity."
Goto FINISH
End If

Set curDB = s.CurrentDatabase
server = curDB.Server
If server = "" Then serverName = "Local"

If db.OpenByReplicaID( server, "852560DE006C7C79" ) Then
Set view = db.GetView("(CustSort)")
Set customerProfile = view.GetDocumentByKey( companyName )
If Not customerProfile Is Nothing Then
Set mailFile = s.CurrentDatabase
Set memos = mailFile.UnprocessedDocuments
count = memos.Count
For n = 1 To count
recipientList = ""
Set memo = memos.GetNthDocument( n )
Set miscActivity = New NotesDocument(db)
miscActivity.Form = "Misc"
Call miscActivity.MakeResponse(customerProfile)
Set docAuthor = New NotesName(memo.From(0))
miscActivity.DocAuthor = docAuthor.Common
miscActivity.ComposeDate = Format$(memo.Created, "mm-dd-yy")
If memo.PostedDate(0) = "" Then
miscActivity.ActivityDate = Format$(memo.Created,
"mm-dd-yy")
Else
miscActivity.ActivityDate =
Format$(memo.PostedDate(0), "mm-dd-yy")
End If
miscActivity.CompanyName = companyName
Set recipient = New NotesName(memo.SendTo(0))
miscActivity.Subject = "Email to " & recipient.Common & "
RE: " & memo.Subject(0)
Set rtitem = New NotesRichTextItem( miscActivity, "Body" )
Set memoBody = memo.GetFirstItem( "Body" ) '
memo.CreateRichTextItem("Body")

This was first published in November 2000

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.