Solved

copying document to a separate DB

Posted on 2000-03-22
9
185 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
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 1

Expert Comment

by:stharris
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 9

Expert Comment

by:Arunkumar
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:skancherla
Comment Utility
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
Comment Utility
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
Comment Utility
it worked! you have helped me at the right time. Thanks very much. Your help is more than appreciation.
0
 

Author Comment

by:skancherla
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
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 seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now