Copy from custom DB into Mail DB using Copy Into functions

Posted on 2003-03-14
Medium Priority
Last Modified: 2013-12-18
I've created a Customer Tracking application for our marketing group.

One of their requests is to have it interact with their personal calendar and mail.  I've told them that I could probably deliver something similar to Copy Into\New Mail, \New Calendar Entry, \New To Do.

I'm thinking the easiest way would be to copy the entire form into the the Calendar\Mail\To Do entry in their mail file.  

Can anyway offer a way to do this?  Idealy, I'd like to just have all the text copy into the body field of each item with appropriate line breaks, but I'd be excited with just copying the entire form.

Question by:jk9783
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
LVL 24

Expert Comment

ID: 8139240
You can use forward action button. This will do exactly what u needed copy the content into the body field of the memo.


Author Comment

ID: 8139540
That works for new mail messages, but what about calendar items and to do's?

Expert Comment

ID: 8139851
The forward works in all the documents !

Author Comment

ID: 8139924
No, I think you're misunderstanding my question.  I want to take items from my custom database and place them into the user's mail file.  So, I want them to be able to place a client's contact information from my custom app into a To Do item in their calendar.

When I forward them, it just pops them into a mail message.

Accepted Solution

psigurd earned 1200 total points
ID: 9320344

Your only option for doing what you want is to use LotusScript to read the field contents of the source document and write to the user's mail database to create documents using the Memo, ToDo or _CalendarEntry forms.  Because this script will be run by the user whose database the document will be created in, there won't be any ACL issues.  The code can be put in a button, or in a form event like QueryClose for the document being exited out of when you want the document creation in the user's mail db to occur.  

Here's a sample of some code.  You would want to copy specific fields not all fields as I've done here. Look in the Lotus Classes documentation for the NotesDocument class

Sub Click(Source As Button)
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Set db = session.CurrentDatabase    
      Dim sourceDocument As NotesDocument
      Dim ws As New notesuiworkspace    
      Dim uidoc As notesuidocument
      Dim CourseInfoDocument As NotesDocument
      Set uidoc = ws.currentdocument  
      Set CourseInfoDocument = uidoc.Document
      ' now build a back end doc for the user to mail to themself or the db Administrator
      Set sourceDocument = db.createDocument
      sourceDocument.form = "A. Create Canada and NEWCRS"
      ' copy all items from the current document into the new document
      Call CourseInfoDocument.CopyAllItems(sourceDocument)
      Call sourceDocument .replaceItemValue("subject", "OA form for course " + CourseInfoDocument.getItemValue("cancode")(0))
      Call sourceDocument .replaceItemValue("principal", "NetLearn to sourceDocument update document")
      Call sourceDocument.send(True, session.username)
      Messagebox ("This document has been mailed to the Mail database for " & Chr$(13) & session.commonusername)
      Call uidoc.close()
End Sub

Featured Post

Technology Partners: 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!

Question has a verified solution.

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

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

777 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