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
Solved

delete documents

Posted on 2004-10-17
5
252 Views
Last Modified: 2013-12-18
Hi Expert,
My form has an action which I want to delete all documents from 2 views and perform some other tasks. For delete documents, I have created 2 agents. When I assign this 2 agent to the action of the form, it always said that I have to run these agents from a view. Is there any way to delete document without using agent?
Thanks,
0
Comment
Question by:khanhna
  • 2
  • 2
5 Comments
 
LVL 13

Expert Comment

by:CRAK
ID: 12336375
You could write code in lotusscript right in the button's Click-event.
Start off at a New NotesSession, use CurrentDatabase to gain a NotesDatabase object. From there use GetView to access a NotesView. From there the approach may depend on what's in it. Either delete doc's one by one or collect a number by key (viewentries or documents) and delete the bunch.

But there's an easier way:
Make the agent run on "all doc's in database".
Press the "Add search" button, select "Folder" and select the view that you want to delete from.
You could use "Simple action" to emtry the view: "Delete from database".

That's all!
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 12336452
can u please paste your code?
It depends on the requirements also. U said it performs other tasks. We want to know what are those other tasks.

if your code is perfect, then in the Agents select RunOnce @Commands....
and run on all documents in view.

This should work.

0
 

Author Comment

by:khanhna
ID: 12336715
Hi CRAK, I write Notes script, and use GetAllDocumentsByKey... and delete one by one... but how can I delete a set of records instead of delete on by one?
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 12336723
no other option.

U have delete one document and refresh the view and get another document and delete.

it is some what tedious method.
Workaround will be to create a view and give the selection formula in the view.

So, it will displayall those documents which are ready to delete. then Select all and delete or u can try with code to delete.
0
 
LVL 13

Accepted Solution

by:
CRAK earned 200 total points
ID: 12336745
All documents have different keys????

I usually perform such larger tasks in separate views, where large numbers of document s(if not all) have the same key (e.g. "A").
GetAllDocumentsByKey("A") will then return a (large) documentcollection. Use RemoveAll(true) to delete all doc's in the collection.

Still.... the simple action is much easier and probably faster!
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

856 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