copying document to a separate DB

Posted on 2000-03-22
Last Modified: 2013-12-18
Hi Experts,
I have a good question for you. Could you please help me, How to copy a document to a separate database by pressing a single button from the web client before deleting the document permanently.
Question by:skancherla
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
  • 3
  • 2
  • 2
  • +1

Expert Comment

ID: 2646254

This is a rather complicated process, and if you want of the Developers (not me) in this forum to help you out you might want to increase the point.....alot.

St. Harris

Expert Comment

ID: 2646260
Oops, that was supposed to say Points (not point).  9 'Points' is considered ultra easy!

St. Harris

Accepted Solution

snocross earned 9 total points
ID: 2646699
1) Have the button set a field on the document:

2) Create a view called 'Archives'
In the view selection formula put:

DeleteThis = "Y"

3) In the WebQuerySave event call an archive agent


Here's the ArchiveAndDelete agent:

     Dim session As New NotesSession
     Dim db As NotesDatabase
     Dim view As Notesview
     Dim doc As Notesdocument    
     Dim archiveDb As New NotesDatabase( "server1/Acme company", "Web\archdb.nsf" )    
     Set db = session.CurrentDatabase
     Set view = db.GetView("Archives")
     Set doc = view.GetFirstDocument
     While Not(doc Is Nothing)
          Call doc.CopyToDatabase( archiveDb )      
          Set doc = view.GetFirstDocument
          REM Set doc = view.GetNextDocument(doc)
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!


Expert Comment

ID: 2648488
Hi Sanjay !!!

Welcome to EE !
Where are you ?  Send me your contact numbers da.  I called up your old number and heard that you have moved to Chicago !  Is that so ?

Keep me updated...


Author Comment

ID: 2650200
I followed all your instructions and copied your code in the agent and when i tryied to delete the document from the web client, you know it is making a copy in the archive database, thats fantastic!, but after copying it is not deleting the document from the original DB. In the Agent, after making a copy to the Archive DB, i have written the code as Call doc.remove(True). It has to delete the document but it is not deleting. i also checked that i have the manager access to the database with Delete documents option checked.

Expert Comment

ID: 2650474
Hmmm... it sounds like the document is not fully closed before it's trying to delete it.  In other words it's executing the FileCloseWindow after the WebQuerySave event gets kicked off.  It can't delete it because you still are in it.  Perhaps you could do this:

1) create a new form called DeleteConfirm that contains the following text:  "THE DOCUMENT HAS SUCCESSFULLY BEEN DELETED".  

2) Remove the WebQuerySave event code from your original form

3) Add the code (the @Command([ToolsRunMacro])) to the WebQueryOpen event on the DeleteConfirm form.

4) Change your button so that after you do your @setfield, @FileSave and @FileCloseWindow you open up the new confirmation form.

Author Comment

ID: 2661544
it worked! you have helped me at the right time. Thanks very much. Your help is more than appreciation.

Author Comment

ID: 2662046
I accepted your answer, marked excellent, i gave you 9 points. Did you get it? For me it tells that you have got 0 points though i gave 9 points to you. please let me know how much u got.

you seems to be genius, can i have your email id? i would like to chat with you.


Expert Comment

ID: 2663651
Hi Sanjay !!!

When you give less than 10 points for a question then 10% of that would be nothing for any person who reads that answer(Anyone can read the answer for free).  

But the excellent grading will give the expert of 9 multiplied by 4 times.  

OK ?  

What happened to my reply to you did you receive it or not ?  Anyway i will call you today at your office da...


Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Email Message Background Color 4 155
Lotus notes view not working using Trim 14 215
sending HTML formatted Lotus Notes email using Java 3 168
IBM Domino web server 5 76
You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

734 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