Solved

copying document to a separate DB

Posted on 2000-03-22
9
193 Views
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.
0
Comment
Question by:skancherla
[X]
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
9 Comments
 
LVL 1

Expert Comment

by:stharris
ID: 2646254
skancherla,

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
0
 
LVL 1

Expert Comment

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

St. Harris
0
 
LVL 5

Accepted Solution

by:
snocross earned 9 total points
ID: 2646699
1) Have the button set a field on the document:
@SetField("DeleteThis"="Y");@Command([FileSave]);@Command([FileCloseWindow])

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

DeleteThis = "Y"

3) In the WebQuerySave event call an archive agent

@Command([ToolsRunMacro];"ArchiveAndDelete")

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 )      
          doc.Remove(True)        
          Set doc = view.GetFirstDocument
          REM Set doc = view.GetNextDocument(doc)
     Wend  
0
Independent Software Vendors: 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!

 
LVL 9

Expert Comment

by:Arunkumar
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...

:)
Arun
0
 

Author Comment

by:skancherla
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.
0
 
LVL 5

Expert Comment

by:snocross
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.
0
 

Author Comment

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

Author Comment

by:skancherla
ID: 2662046
snocross,
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.

0
 
LVL 9

Expert Comment

by:Arunkumar
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...

-Arun
0

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

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
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

728 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