?
Solved

delete documents

Posted on 2004-10-17
5
Medium Priority
?
256 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
[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
  • 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 800 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month10 days, 10 hours left to enroll

765 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